read

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 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
}

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

Jump to

Keyboard shortcuts

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