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
}
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 are read in the meaning rules' stage, so one run names the problems of both.