Documentation ¶
Index ¶
- func FindDashboard(name string, cfg *configpb.Configuration) *configpb.Dashboard
- func FindTestGroup(name string, cfg *configpb.Configuration) *configpb.TestGroup
- func MarshalBytes(c *configpb.Configuration) ([]byte, error)
- func MarshalText(c *configpb.Configuration, w io.Writer) error
- func Read(path string, ctx context.Context, client *storage.Client) (*configpb.Configuration, error)
- func ReadGCS(ctx context.Context, opener gcs.Opener, path gcs.Path) (*configpb.Configuration, error)
- func ReadPath(path string) (*configpb.Configuration, error)
- func Unmarshal(r io.Reader) (*configpb.Configuration, error)
- func Validate(c *configpb.Configuration) error
- type ConfigError
- type DuplicateNameError
- type MissingEntityError
- type MissingFieldError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindDashboard ¶
func FindDashboard(name string, cfg *configpb.Configuration) *configpb.Dashboard
FindDashboard returns the configpb.Dashboard proto for a given Dashboard name.
func FindTestGroup ¶
func FindTestGroup(name string, cfg *configpb.Configuration) *configpb.TestGroup
FindTestGroup returns the configpb.TestGroup proto for a given TestGroup name.
func MarshalBytes ¶
func MarshalBytes(c *configpb.Configuration) ([]byte, error)
MarshalBytes returns the wire-encoded protobuf data for the parsed configuration. Returns an error if config is invalid or encoding failed.
func MarshalText ¶
func MarshalText(c *configpb.Configuration, w io.Writer) error
MarshalText writes a text version of the parsed configuration to the supplied io.Writer. Returns an error if config is invalid or writing failed.
func Read ¶
func Read(path string, ctx context.Context, client *storage.Client) (*configpb.Configuration, error)
Read will read the Configuration proto message from a local or gs:// path.
The ctx and client are only relevant when path refers to GCS.
func ReadGCS ¶
func ReadGCS(ctx context.Context, opener gcs.Opener, path gcs.Path) (*configpb.Configuration, error)
ReadGCS opens the config at path and unmarshals it into a Configuration proto.
func ReadPath ¶
func ReadPath(path string) (*configpb.Configuration, error)
ReadPath reads the config from the specified local file path.
func Unmarshal ¶
func Unmarshal(r io.Reader) (*configpb.Configuration, error)
Unmarshal reads a protocol buffer into memory
func Validate ¶
func Validate(c *configpb.Configuration) error
Validate checks that a configuration is well-formed.
Types ¶
type ConfigError ¶ added in v0.0.4
ConfigError is an error for invalid configuration that includes what entity errored.
func (ConfigError) Error ¶ added in v0.0.4
func (e ConfigError) Error() string
type DuplicateNameError ¶ added in v0.0.3
DuplicateNameError is an error that includes the duplicate name.
func (DuplicateNameError) Error ¶ added in v0.0.3
func (e DuplicateNameError) Error() string
type MissingEntityError ¶ added in v0.0.4
MissingEntityError is an error that includes the missing entity.
func (MissingEntityError) Error ¶ added in v0.0.4
func (e MissingEntityError) Error() string
type MissingFieldError ¶
type MissingFieldError struct {
Field string
}
MissingFieldError is an error that includes the missing field.
func (MissingFieldError) Error ¶
func (e MissingFieldError) Error() string