Documentation ¶
Index ¶
- func NewSecret(name, privateKey, certificateChain string) *auth.Secret
- func ResourcesToJSON(pb proto.Message) ([]byte, error)
- type B64JSON
- type Callbacks
- func (cb *Callbacks) OnFetchRequest(ctx context.Context, req *v2.DiscoveryRequest) error
- func (cb *Callbacks) OnFetchResponse(req *v2.DiscoveryRequest, resp *v2.DiscoveryResponse)
- func (cb *Callbacks) OnStreamClosed(id int64)
- func (cb *Callbacks) OnStreamOpen(ctx context.Context, id int64, typ string) error
- func (cb *Callbacks) OnStreamRequest(id int64, req *v2.DiscoveryRequest) error
- func (cb *Callbacks) OnStreamResponse(id int64, req *v2.DiscoveryRequest, rsp *v2.DiscoveryResponse)
- type JSON
- type ResourceMarshaller
- type ResourceUnmarshaller
- type Resources
- type XdsServer
- type YAML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callbacks ¶
type Callbacks struct { OnError func(nodeID, previousVersion, msg string) error SnapshotCache *cache.SnapshotCache }
Callbacks is a type that implements go-control-plane/pkg/server/Callbacks
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 ¶
func (cb *Callbacks) OnFetchResponse(req *v2.DiscoveryRequest, resp *v2.DiscoveryResponse)
OnFetchResponse implements go-control-plane/pkg/server/Callbacks.OnFetchRequest OnFetchResponse is called immediately prior to sending a response.
func (*Callbacks) OnStreamClosed ¶
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) OnStreamOpen ¶
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 *v2.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 ¶
func (cb *Callbacks) OnStreamResponse(id int64, req *v2.DiscoveryRequest, rsp *v2.DiscoveryResponse)
OnStreamResponse implements go-control-plane/pkgserver/Callbacks.OnStreamResponse OnStreamResponse is called immediately prior to sending a response on a stream.
type JSON ¶ added in v0.4.1
type JSON struct{}
type ResourceMarshaller ¶ added in v0.4.1
type ResourceMarshaller interface {
Marshal(xds_cache_types.Resource) (string, error)
}
type ResourceUnmarshaller ¶ added in v0.4.1
type ResourceUnmarshaller interface {
Unmarshal(string, xds_cache_types.Resource) error
}
type Resources ¶ added in v0.4.1
type Resources struct { Clusters []*envoyapi.Cluster `protobuf:"bytes,2,rep,name=clusters,json=clusters" json:"clusters"` Listeners []*envoyapi.Listener `protobuf:"bytes,4,rep,name=listeners,json=listeners" json:"listeners"` }
Resources is a struct that holds the different envoy resources types so it can be deserialized directly from the yaml representation
func YAMLtoResources ¶ added in v0.4.1
YAMLtoResources -> DeserializeYAML([]byte(configMap.Data["config.yaml"]))
func (*Resources) ProtoMessage ¶ added in v0.4.1
func (*Resources) ProtoMessage()
ProtoMessage is noop function for resFromFile to implement protobuf interface
type XdsServer ¶
type XdsServer struct {
// contains filtered or unexported fields
}
XdsServer is a type that holds configuration and runtime objects for the envoy xds server
func NewXdsServer ¶
func NewXdsServer(ctx context.Context, adsPort uint, tlsConfig *tls.Config, callbacks *Callbacks) *XdsServer
NewXdsServer creates a new XdsServer object fron the given params
func (*XdsServer) GetSnapshotCache ¶
func (xdss *XdsServer) GetSnapshotCache() *cache.SnapshotCache
GetSnapshotCache returns the xds_cache.SnapshotCache