cache

package
v1.1.4-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package cache implements a cache of all the resources that are relevant to the gateway

Package cache is a generated GoMock package.

Package cache is a generated GoMock package.

Package cache contains the cache for the gateway

Index

Constants

View Source
const (
	// KindService is the kind used to represent the service
	KindService = "Service"

	// KindServiceImport is the kind used to represent the service import
	KindServiceImport = "ServiceImport"

	// KindSecret is the kind used to represent the secret
	KindSecret = "Secret"

	// GroupFlomeshIo is the group used to represent the flomesh.io group
	GroupFlomeshIo = "flomesh.io"

	// GroupCore is the group used to represent the core group
	GroupCore = ""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	Insert(obj interface{}) bool
	Delete(obj interface{}) bool
	BuildConfigs()
}

Cache is the interface for the functionality provided by the cache

type EndpointSlicesProcessor

type EndpointSlicesProcessor struct {
}

EndpointSlicesProcessor is responsible for processing EndpointSlices

func (*EndpointSlicesProcessor) Delete

func (p *EndpointSlicesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes the EndpointSlice object from the cache and returns true if the cache was modified

func (*EndpointSlicesProcessor) Insert

func (p *EndpointSlicesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds the EndpointSlice object to the cache and returns true if the cache was modified

type EndpointsProcessor

type EndpointsProcessor struct {
}

EndpointsProcessor is responsible for processing Endpoints objects

func (*EndpointsProcessor) Delete

func (p *EndpointsProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes the Endpoints object from the cache and returns true if the cache was modified

func (*EndpointsProcessor) Insert

func (p *EndpointsProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds the Endpoints object to the cache and returns true if the cache was modified

type GRPCRoutesProcessor

type GRPCRoutesProcessor struct {
}

GRPCRoutesProcessor is responsible for processing GRPCRoute objects

func (*GRPCRoutesProcessor) Delete

func (p *GRPCRoutesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a GRPCRoute from the cache and returns true if the route was found

func (*GRPCRoutesProcessor) Insert

func (p *GRPCRoutesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a GRPCRoute to the cache and returns true if the route is effective

type GatewayCache

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

GatewayCache is a cache of all the resources that are relevant to the gateway

func NewGatewayCache

func NewGatewayCache(informerCollection *informers.InformerCollection, kubeClient kubernetes.Interface, cfg configurator.Configurator) *GatewayCache

NewGatewayCache creates a new gateway cache

func (*GatewayCache) BuildConfigs

func (c *GatewayCache) BuildConfigs()

BuildConfigs builds the configs for all the gateways in the cache

func (*GatewayCache) Delete

func (c *GatewayCache) Delete(obj interface{}) bool

Delete deletes an object from the cache

func (*GatewayCache) Insert

func (c *GatewayCache) Insert(obj interface{}) bool

Insert inserts an object into the cache

type GatewayClassesProcessor

type GatewayClassesProcessor struct {
}

GatewayClassesProcessor is responsible for processing GatewayClass objects

func (*GatewayClassesProcessor) Delete

func (p *GatewayClassesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes the GatewayClass object from the cache and returns true if the cache was modified

func (*GatewayClassesProcessor) Insert

func (p *GatewayClassesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds the GatewayClass object to the cache and returns true if the cache was modified

type GatewaysProcessor

type GatewaysProcessor struct {
}

GatewaysProcessor is responsible for processing Gateway objects

func (*GatewaysProcessor) Delete

func (p *GatewaysProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes the Gateway object from the cache and returns true if the cache was modified

func (*GatewaysProcessor) Insert

func (p *GatewaysProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds the Gateway object to the cache and returns true if the cache was modified

type HTTPRoutesProcessor

type HTTPRoutesProcessor struct {
}

HTTPRoutesProcessor is responsible for processing HTTPRoute objects

func (*HTTPRoutesProcessor) Delete

func (p *HTTPRoutesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a HTTPRoute from the cache and returns true if the route was found

func (*HTTPRoutesProcessor) Insert

func (p *HTTPRoutesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a HTTPRoute to the cache and returns true if the route is effective

type MockCache

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

MockCache is a mock of Cache interface.

func NewMockCache

func NewMockCache(ctrl *gomock.Controller) *MockCache

NewMockCache creates a new mock instance.

func (*MockCache) BuildConfigs

func (m *MockCache) BuildConfigs()

BuildConfigs mocks base method.

func (*MockCache) Delete

func (m *MockCache) Delete(arg0 interface{}) bool

Delete mocks base method.

func (*MockCache) EXPECT

func (m *MockCache) EXPECT() *MockCacheMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCache) Insert

func (m *MockCache) Insert(arg0 interface{}) bool

Insert mocks base method.

type MockCacheMockRecorder

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

MockCacheMockRecorder is the mock recorder for MockCache.

func (*MockCacheMockRecorder) BuildConfigs

func (mr *MockCacheMockRecorder) BuildConfigs() *gomock.Call

BuildConfigs indicates an expected call of BuildConfigs.

func (*MockCacheMockRecorder) Delete

func (mr *MockCacheMockRecorder) Delete(arg0 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockCacheMockRecorder) Insert

func (mr *MockCacheMockRecorder) Insert(arg0 interface{}) *gomock.Call

Insert indicates an expected call of Insert.

type MockProcessor

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

MockProcessor is a mock of Processor interface.

func NewMockProcessor

func NewMockProcessor(ctrl *gomock.Controller) *MockProcessor

NewMockProcessor creates a new mock instance.

func (*MockProcessor) Delete

func (m *MockProcessor) Delete(arg0 interface{}, arg1 *GatewayCache) bool

Delete mocks base method.

func (*MockProcessor) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProcessor) Insert

func (m *MockProcessor) Insert(arg0 interface{}, arg1 *GatewayCache) bool

Insert mocks base method.

type MockProcessorMockRecorder

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

MockProcessorMockRecorder is the mock recorder for MockProcessor.

func (*MockProcessorMockRecorder) Delete

func (mr *MockProcessorMockRecorder) Delete(arg0, arg1 interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockProcessorMockRecorder) Insert

func (mr *MockProcessorMockRecorder) Insert(arg0, arg1 interface{}) *gomock.Call

Insert indicates an expected call of Insert.

type Processor

type Processor interface {
	Insert(obj interface{}, cache *GatewayCache) bool
	Delete(obj interface{}, cache *GatewayCache) bool
}

Processor is the interface for the functionality provided by the processors

type ProcessorType

type ProcessorType string

ProcessorType is the type used to represent the type of processor

const (
	// ServicesProcessorType is the type used to represent the services processor
	ServicesProcessorType ProcessorType = "services"

	// EndpointSlicesProcessorType is the type used to represent the endpoint slices processor
	EndpointSlicesProcessorType ProcessorType = "endpointslices"

	// EndpointsProcessorType is the type used to represent the endpoints processor
	EndpointsProcessorType ProcessorType = "endpoints"

	// ServiceImportsProcessorType is the type used to represent the service imports processor
	ServiceImportsProcessorType ProcessorType = "serviceimports"

	// SecretsProcessorType is the type used to represent the secrets processor
	SecretsProcessorType ProcessorType = "secrets"

	// GatewayClassesProcessorType is the type used to represent the gateway classes processor
	GatewayClassesProcessorType ProcessorType = "gatewayclasses"

	// GatewaysProcessorType is the type used to represent the gateways processor
	GatewaysProcessorType ProcessorType = "gateways"

	// HTTPRoutesProcessorType is the type used to represent the HTTP routes processor
	HTTPRoutesProcessorType ProcessorType = "httproutes"

	// GRPCRoutesProcessorType is the type used to represent the gRPC routes processor
	GRPCRoutesProcessorType ProcessorType = "grpcroutes"

	// TCPRoutesProcessorType is the type used to represent the TCP routes processor
	TCPRoutesProcessorType ProcessorType = "tcproutes"

	// TLSRoutesProcessorType is the type used to represent the TLS routes processor
	TLSRoutesProcessorType ProcessorType = "tlsroutes"
)

type SecretProcessor

type SecretProcessor struct {
}

SecretProcessor is a processor for Secret objects

func (*SecretProcessor) Delete

func (p *SecretProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a Secret object from the cache and returns true if the cache is changed

func (*SecretProcessor) Insert

func (p *SecretProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a Secret object to the cache and returns true if the cache is changed

type ServiceImportsProcessor

type ServiceImportsProcessor struct {
}

ServiceImportsProcessor is responsible for processing ServiceImport objects

func (*ServiceImportsProcessor) Delete

func (p *ServiceImportsProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a ServiceImport from the cache and returns true if the route was found

func (*ServiceImportsProcessor) Insert

func (p *ServiceImportsProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a ServiceImport to the cache and returns true if the route is effective

type ServicesProcessor

type ServicesProcessor struct{}

ServicesProcessor is responsible for processing Service objects

func (*ServicesProcessor) Delete

func (p *ServicesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes the Service object from the cache and returns true if the cache was modified

func (*ServicesProcessor) Insert

func (p *ServicesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds the Service object to the cache and returns true if the cache was modified

type TCPRoutesProcessor

type TCPRoutesProcessor struct {
}

TCPRoutesProcessor is responsible for processing TCPRoute objects

func (*TCPRoutesProcessor) Delete

func (p *TCPRoutesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a TCPRoute from the cache and returns true if the route was found

func (*TCPRoutesProcessor) Insert

func (p *TCPRoutesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a TCPRoute to the cache and returns true if the route is effective

type TLSRoutesProcessor

type TLSRoutesProcessor struct {
}

TLSRoutesProcessor is responsible for processing TLSRoute objects

func (*TLSRoutesProcessor) Delete

func (p *TLSRoutesProcessor) Delete(obj interface{}, cache *GatewayCache) bool

Delete removes a TLSRoute from the cache and returns true if the route was found

func (*TLSRoutesProcessor) Insert

func (p *TLSRoutesProcessor) Insert(obj interface{}, cache *GatewayCache) bool

Insert adds a TLSRoute to the cache and returns true if the route is effective

Jump to

Keyboard shortcuts

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