read

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package read turns a proxyfile into the model, or into the problems that stop the run.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File added in v1.1.0

type File struct {
	Gateway *model.Gateway
	Origins *origins.File // read from the proxyfile; nil when "origins" names a file, which render.Read reads
	Methods []rpc.Method  // rpc.methods in written order; nil when not written or written empty
	// MethodsKey is the methods key inside rpc, nil when the proxyfile does not write it. render.Read tells an empty
	// list from none by it, and names it when --rpc-methods is given as well.
	MethodsKey *model.Pos
	Proto      *Proto // rpc.proto; nil when not written
	// Included is every file the include statements of a HOCON proxyfile name, also one that does not exist, in the
	// order first named; nil for a YAML proxyfile, which has no includes. They are inputs of the run, so no output
	// may name one.
	Included []string
}

File is a proxyfile after reading. The origins and the RPC methods it may hold have their types in packages that import model, so they sit beside the gateway rather than in it.

func Proxyfile

func Proxyfile(path string) (*File, []model.Problem)

Proxyfile reads a proxyfile and returns its model and the origins and RPC methods it writes, or the problems that stop the run. It chooses the form by the file name: a file named Proxyfile or ending in .conf is HOCON, one ending in .yaml or .yml is YAML.

The stages run in order and the first that finds a problem ends the run with all of its problems, sorted. Each stage may then rely on the one before: decoding reads only a tree the check accepted, and the meaning rules read only a complete model. The origins and rpc.proto are read in the meaning rules' stage, so one run names the problems of all three.

type Proto added in v1.3.0

type Proto struct {
	// Key is the proto key, which the problem of --rpc-methods given as well names. OptionKey is the option key,
	// which every problem of the option names.
	Key, OptionKey model.Pos
	Roots          []model.Text // in written order, each at the place its problems name
	Option         string       // the option's full name
}

Proto is rpc.proto as written. render.Read resolves the roots against the proxyfile's directory and compiles the .proto files under them, so this holds only the text and the places its problems name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL