applications

package
v0.0.0-...-869df34 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Namespace           string
	ServiceAccountName  string
	Name                string
	PathPrefix          string
	ServingPort         uint32
	ServingProtocol     string
	HealthCheckPort     uint32
	HealthCheckProtocol string
	Endpoints           []ApplicationEndpoints
}

Application represents an application, e.g., a gRPC server, that clients discover using xDS.

func NewApplication

func NewApplication(namespace string, name string, servingPort uint32, servingProtocol string, healthCheckPort uint32, healthCheckProtocol string, endpoints []ApplicationEndpoints) Application

NewApplication is a convenience function that creates a Application where the k8s ServiceAccount and the application share the same name.

func (Application) Compare

func (a Application) Compare(b Application) int

Compare assumes that the list of endpoints is sorted, as done in `NewApplication()`.

func (Application) Equal

func (a Application) Equal(b Application) bool

Equal assumes that the list of endpoints is sorted, as done in `NewApplication()`.

type ApplicationCache

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

The ApplicationCache key is `<kubecontext>/<namespace>`.

func NewApplicationCache

func NewApplicationCache() *ApplicationCache

func (*ApplicationCache) Get

func (c *ApplicationCache) Get(kubecontextName string, namespace string) []Application

func (*ApplicationCache) GetAll

func (c *ApplicationCache) GetAll() []Application

func (*ApplicationCache) Put

func (c *ApplicationCache) Put(kubecontextName string, namespace string, apps []Application) bool

Put returns true iff the update changed the cache. Use the return value to avoid sending xDS updates to clients when nothing has changed.

type ApplicationEndpoints

type ApplicationEndpoints struct {
	Node           string
	Zone           string
	Addresses      []string
	EndpointStatus EndpointStatus
}

func NewApplicationEndpoints

func NewApplicationEndpoints(node string, zone string, addresses []string, endpointStatus EndpointStatus) ApplicationEndpoints

func (ApplicationEndpoints) Compare

Compare assumes that the list of addresses is sorted, as done in `NewApplicationEndpoints()`.

func (ApplicationEndpoints) Equal

Equal assumes that the list of addresses is sorted, as done in `NewApplicationEndpoints()`.

type EndpointStatus

type EndpointStatus int

EndpointStatus represents the serving status of an endpoint.

Translates from Kubernetes EndpointSlice conditions to xDS HealthStatus as used in EDS ClusterLoadAssignment resources.

const (
	Healthy EndpointStatus = iota
	Unhealthy
	Draining
)

func (EndpointStatus) HealthStatus

func (e EndpointStatus) HealthStatus() corev3.HealthStatus

func (EndpointStatus) String

func (e EndpointStatus) String() string

Jump to

Keyboard shortcuts

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