client

package
Version: v0.0.0-...-4e1f4d9 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// WatchResources watches for the specified resource on the federated
	// service mesh owner and notifies via the supplied observer.
	WatchResources(ctx context.Context, resourceUrl string, observer ResourceObserver) error

	// WatchFederatedServices watches for notifications related to federated
	// services on the federated service mesh owner.
	WatchFederatedServices(ctx context.Context, observer FederatedServiceObserver) error
}

Client is an abstraction over the federated resource discovery protocol to be implemented by the client.

func NewClient

func NewClient(serverAddr string, tlsConfig *tls.Config) (Client, error)

NewClient creates a new client instance.

type FederatedServiceObserver

type FederatedServiceObserver interface {
	// OnCreate is called when a new federated service is created.
	OnCreate(*types.FederatedService) error

	// OnUpdate is called when an existing federated service is updated.
	OnUpdate(*types.FederatedService) error

	// OnDelete is called when an existing federated service is deleted.
	OnDelete(*types.FederatedService) error
}

FederatedServiceObserver is an observer that receives notifications when federated services are created, updated, or deleted.

type ResourceObserver

type ResourceObserver interface {
	// OnCreate is called when a new resource is created.
	OnCreate(*any.Any) error

	// OnUpdate is called when an existing resource is updated.
	OnUpdate(*any.Any) error

	// OnDelete is called when an existing resource is deleted.
	OnDelete(*any.Any) error
}

ResourceObserver is a generic resource observer that receives notifications when resources are created, updated, or deleted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL