discoveryservice

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache implements "github.com/3scale-ops/marin3r/pkg/discoveryservice/xdss".Cache for envoy API v3.

func NewCache

func NewCache() Cache

NewCache returns a Cache object.

func NewCacheFromSnapshotCache added in v0.11.0

func NewCacheFromSnapshotCache(v3 cache_v3.SnapshotCache) Cache

NewCache returns a Cache object.

func (Cache) ClearSnapshot

func (c Cache) ClearSnapshot(nodeID string)

ClearSnapshot clears snapshot and info for a node.

func (Cache) GetSnapshot

func (c Cache) GetSnapshot(nodeID string) (xdss.Snapshot, error)

GetSnapshot gets the snapshot for a node, and returns an error if not found.

func (Cache) NewSnapshot

func (c Cache) NewSnapshot() xdss.Snapshot

func (Cache) SetSnapshot

func (c Cache) SetSnapshot(ctx context.Context, nodeID string, snap xdss.Snapshot) error

SetSnapshot updates a snapshot for a node.

type Callbacks

type Callbacks struct {
	Stats  *stats.Stats
	Logger logr.Logger
}

Callbacks is a type that implements go-control-plane/pkg/server/Callbacks

func (*Callbacks) OnDeltaStreamClosed added in v0.9.0

func (cb *Callbacks) OnDeltaStreamClosed(int64, *envoy_config_core_v3.Node)

OnDeltaStreamClosed is called immediately prior to closing an xDS stream with a stream ID.

func (*Callbacks) OnDeltaStreamOpen added in v0.9.0

func (cb *Callbacks) OnDeltaStreamOpen(context.Context, int64, string) error

OnDeltaStreamOpen is called once an incremental xDS stream is open with a stream ID and the type URL (or "" for ADS). Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (*Callbacks) OnFetchRequest

OnFetchRequest implements go-control-plane/pkg/server/Callbacks.OnFetchRequest OnFetchRequest is called for each Fetch request. Returning an error will end processing of the request and respond with an error.

func (*Callbacks) OnFetchResponse

OnFetchResponse implements go-control-plane/pkg/server/Callbacks.OnFetchRequest OnFetchResponse is called immediately prior to sending a response.

func (*Callbacks) OnStreamClosed

func (cb *Callbacks) OnStreamClosed(id int64, node *envoy_config_core_v3.Node)

OnStreamClosed implements go-control-plane/pkg/server/Callbacks.OnStreamClosed OnStreamClosed is called immediately prior to closing an xDS stream with a stream ID.

func (*Callbacks) OnStreamDeltaRequest added in v0.9.0

OnStreamDeltaRequest is called once a request is received on a stream. Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (*Callbacks) OnStreamDeltaResponse added in v0.9.0

OnStreamDelatResponse is called immediately prior to sending a response on a stream.

func (*Callbacks) OnStreamOpen

func (cb *Callbacks) OnStreamOpen(ctx context.Context, id int64, typ string) error

OnStreamOpen implements go-control-plane/pkg/server/Callbacks.OnStreamOpen Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (*Callbacks) OnStreamRequest

func (cb *Callbacks) OnStreamRequest(id int64, req *envoy_service_discovery_v3.DiscoveryRequest) error

OnStreamRequest implements go-control-plane/pkg/server/Callbacks.OnStreamRequest OnStreamRequest is called once a request is received on a stream. Returning an error will end processing and close the stream. OnStreamClosed will still be called.

func (*Callbacks) OnStreamResponse

OnStreamResponse implements go-control-plane/pkgserver/Callbacks.OnStreamResponse OnStreamResponse is called immediately prior to sending a response on a stream.

type Snapshot

type Snapshot struct {
	// contains filtered or unexported fields
}

Snapshot implements "github.com/3scale-ops/marin3r/pkg/discoveryservice/xdss".Snapshot for envoy API v3.

func NewSnapshot

func NewSnapshot() Snapshot

NewSnapshot returns a Snapshot object

func (Snapshot) Consistent

func (s Snapshot) Consistent() error

Consistent check verifies that the dependent resources are exactly listed in the snapshot: - all EDS resources are listed by name in CDS resources - all RDS resources are listed by name in LDS resources

Note that clusters and listeners are requested without name references, so Envoy will accept the snapshot list of clusters as-is even if it does not match all references found in xDS.

func (Snapshot) GetResources

func (s Snapshot) GetResources(rType envoy.Type) map[string]envoy.Resource

GetResources selects snapshot resources by type.

func (Snapshot) GetVersion

func (s Snapshot) GetVersion(rType envoy.Type) string

GetVersion returns the version for a resource type.

func (Snapshot) SetResources added in v0.11.0

func (s Snapshot) SetResources(rType envoy.Type, resources []envoy.Resource) xdss.Snapshot

func (Snapshot) SetVersion

func (s Snapshot) SetVersion(rType envoy.Type, version string)

SetVersion sets the version for a resource type.

Jump to

Keyboard shortcuts

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