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 ¶
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.