context

package
v0.0.0-...-183c8bc Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedMeshContexts

type AggregatedMeshContexts struct {
	Hash               string
	Meshes             []*core_mesh.MeshResource
	MeshContextsByName map[string]MeshContext
}

AggregatedMeshContexts is an aggregate of all MeshContext across all meshes

func AggregateMeshContexts

func AggregateMeshContexts(
	ctx context.Context,
	resManager manager.ReadOnlyResourceManager,
	fetcher meshContextFetcher,
) (AggregatedMeshContexts, error)

func (AggregatedMeshContexts) AllDataplanes

func (m AggregatedMeshContexts) AllDataplanes() []*core_mesh.DataplaneResource

func (AggregatedMeshContexts) MustGetMeshContext

func (m AggregatedMeshContexts) MustGetMeshContext(meshName string) MeshContext

MustGetMeshContext panics if there is no mesh context for given mesh. Call it when iterating over .Meshes There is a guarantee that for every Mesh in .Meshes there is a MeshContext.

func (AggregatedMeshContexts) ZoneIngresses

type BaseMeshContext

type BaseMeshContext struct {
	Mesh        *core_mesh.MeshResource
	ResourceMap ResourceMap
	// contains filtered or unexported fields
}

BaseMeshContext holds for a Mesh a set of resources that are changing less often (policies, external services...)

func (BaseMeshContext) Hash

func (g BaseMeshContext) Hash() string

Hash base64 version of the hash mostly useed for testing

type ConnectionInfo

type ConnectionInfo struct {
	// Authority defines the URL that was used by the data plane to connect to the control plane
	Authority string
}

type Context

type Context struct {
	ControlPlane *ControlPlaneContext
	Mesh         MeshContext
}

type ControlPlaneContext

type ControlPlaneContext struct {
	CLACache envoy.CLACache
	Zone     string
}

ControlPlaneContext contains shared global data and components that are required for generating XDS This data is the same regardless of a data plane proxy and mesh we are generating the data for.

type GlobalContext

type GlobalContext struct {
	ResourceMap ResourceMap
	// contains filtered or unexported fields
}

GlobalContext holds resources that are Global

func (GlobalContext) Hash

func (g GlobalContext) Hash() string

Hash base64 version of the hash mostly used for testing

type MeshContext

type MeshContext struct {
	Hash                string
	Resource            *core_mesh.MeshResource
	Resources           Resources
	DataplanesByName    map[string]*core_mesh.DataplaneResource
	EndpointMap         xds.EndpointMap
	ServicesInformation map[string]*ServiceInformation
}

func (*MeshContext) GetServiceProtocol

func (mc *MeshContext) GetServiceProtocol(serviceName string) core_mesh.Protocol

type MeshContextBuilder

type MeshContextBuilder interface {
	// BuildGlobalContextIfChanged builds GlobalContext only if `latest` is nil or hash is different
	// If hash is the same, the return `latest`
	BuildGlobalContextIfChanged(ctx context.Context, latest *GlobalContext) (*GlobalContext, error)

	// BuildIfChanged builds MeshContext only if latestMeshCtx is nil or hash of
	// latestMeshCtx is different.
	// If hash is the same, then the function returns the passed latestMeshCtx.
	// Hash returned in MeshContext can never be empty.
	BuildIfChanged(ctx context.Context, meshName string, latestMeshCtx *MeshContext) (*MeshContext, error)
}

type ResourceMap

func (ResourceMap) Hash

func (rm ResourceMap) Hash() []byte

type Resources

type Resources struct {
	MeshLocalResources ResourceMap
}

Resources mulity mesh soon

func NewResources

func NewResources() Resources

func (Resources) Dataplanes

func (r Resources) Dataplanes() *core_mesh.DataplaneResourceList

func (Resources) ListOrEmpty

func (r Resources) ListOrEmpty(resourceType core_model.ResourceType) core_model.ResourceList

func (Resources) ZoneIngresses

func (r Resources) ZoneIngresses() *core_mesh.ZoneIngressResourceList

type ServiceInformation

type ServiceInformation struct {
	TLSReadiness      bool
	Protocol          core_mesh.Protocol
	IsExternalService bool
}

Jump to

Keyboard shortcuts

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