galley

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {

	// SinkAddress to dial-out to, if set.
	SinkAddress string

	// MeshConfig to use for this instance.
	MeshConfig string
}

Config for Galley

type Instance

type Instance interface {
	resource.Resource

	// Address of the Galley MCP Server.
	Address() string

	// ApplyConfig applies the given config yaml text via Galley.
	ApplyConfig(ns namespace.Instance, yamlText ...string) error

	// ApplyConfigOrFail applies the given config yaml text via Galley.
	ApplyConfigOrFail(t *testing.T, ns namespace.Instance, yamlText ...string)

	// DeleteConfig deletes the given config yaml text via Galley.
	DeleteConfig(ns namespace.Instance, yamlText ...string) error

	// DeleteConfigOrFail deletes the given config yaml text via Galley.
	DeleteConfigOrFail(t *testing.T, ns namespace.Instance, yamlText ...string)

	// ApplyConfigDir recursively applies all the config files in the specified directory
	ApplyConfigDir(ns namespace.Instance, configDir string) error

	// ClearConfig clears all applied config so far.
	ClearConfig() error

	// WaitForSnapshot waits until the given snapshot is observed for the given type URL.
	WaitForSnapshot(collection string, validator SnapshotValidatorFunc) error
}

Instance of Galley

func New

func New(ctx resource.Context, cfg Config) (i Instance, err error)

New returns a new instance of echo.

func NewOrFail

func NewOrFail(t *testing.T, c resource.Context, cfg Config) Instance

NewOrFail returns a new Galley instance, or fails test.

type SnapshotObject

type SnapshotObject struct {
	TypeURL  string        `protobuf:"bytes,1,opt,name=TypeURL,proto3" json:"TypeURL,omitempty"`
	Metadata *mcp.Metadata `protobuf:"bytes,2,opt,name=Metadata,proto3" json:"Metadata,omitempty"`
	Body     proto.Message `protobuf:"bytes,3,opt,name=Body,proto3" json:"Body,omitempty"`
}

SnapshotObject contains a decoded versioned object with metadata received from the server.

func (*SnapshotObject) ProtoMessage

func (*SnapshotObject) ProtoMessage()

func (*SnapshotObject) Reset

func (m *SnapshotObject) Reset()

func (*SnapshotObject) String

func (m *SnapshotObject) String() string

type SnapshotValidatorFunc

type SnapshotValidatorFunc func(actuals []*SnapshotObject) error

SnapshotValidatorFunc validates the given snapshot objects returned from Galley.

func NewGoldenSnapshotValidator

func NewGoldenSnapshotValidator(goldens []map[string]interface{}) SnapshotValidatorFunc

NewGoldenSnapshotValidator creates a SnapshotValidatorFunc that tests for equivalence against a set of golden object.

func NewSingleObjectSnapshotValidator

func NewSingleObjectSnapshotValidator(fn func(actual *SnapshotObject) error) SnapshotValidatorFunc

NewSingleObjectSnapshotValidator creates a SnapshotValidatorFunc that ensures only a single object is found in the snapshot.

Jump to

Keyboard shortcuts

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