service

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Package service is a generated GoMock package.

Package service models an instance of a service managed by OSM controller and utility routines associated with it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterName

type ClusterName string

ClusterName is a type for a service name

func (ClusterName) String added in v0.6.0

func (c ClusterName) String() string

String returns the given ClusterName type as a string

type Locality added in v0.10.0

type Locality int

Locality is the relative locality of a service. ie: if a service is being accessed from the same namespace or a remote cluster.

const (
	// LocalNS refers to the local namespace within the local cluster.
	LocalNS Locality = iota

	// LocalCluster refers to access within the cluster, but not within the same namespace.
	LocalCluster

	// RemoteCluster refers to access from a different cluster.
	RemoteCluster
)

type MeshService added in v0.1.0

type MeshService struct {
	// If the service resides on a Kubernetes service, this would be the Kubernetes namespace.
	Namespace string

	// The name of the service
	Name string
}

MeshService is the struct defining a service (Kubernetes or otherwise) within a service mesh.

func (MeshService) Equals added in v0.1.0

func (ms MeshService) Equals(service MeshService) bool

Equals checks if two namespaced services are equal

func (MeshService) FQDN added in v0.10.0

func (ms MeshService) FQDN() string

FQDN is similar to String(), but uses a dot separator and is in a different order.

func (MeshService) NameWithoutCluster added in v0.10.0

func (ms MeshService) NameWithoutCluster() string

NameWithoutCluster returns a string

func (MeshService) ServerName added in v0.6.0

func (ms MeshService) ServerName() string

ServerName returns the Server Name Identifier (SNI) for TLS connections

func (MeshService) String added in v0.1.0

func (ms MeshService) String() string

type MockProvider added in v0.10.0

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

MockProvider is a mock of Provider interface

func NewMockProvider added in v0.10.0

func NewMockProvider(ctrl *gomock.Controller) *MockProvider

NewMockProvider creates a new mock instance

func (*MockProvider) EXPECT added in v0.10.0

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

func (*MockProvider) GetHostnamesForService added in v0.10.0

func (m *MockProvider) GetHostnamesForService(arg0 MeshService, arg1 Locality) ([]string, error)

GetHostnamesForService mocks base method

func (*MockProvider) GetID added in v0.10.0

func (m *MockProvider) GetID() string

GetID mocks base method

func (*MockProvider) GetPortToProtocolMappingForService added in v0.10.0

func (m *MockProvider) GetPortToProtocolMappingForService(arg0 MeshService) (map[uint32]string, error)

GetPortToProtocolMappingForService mocks base method

func (*MockProvider) GetServicesForServiceIdentity added in v0.10.0

func (m *MockProvider) GetServicesForServiceIdentity(arg0 identity.ServiceIdentity) ([]MeshService, error)

GetServicesForServiceIdentity mocks base method

func (*MockProvider) GetTargetPortToProtocolMappingForService added in v0.10.0

func (m *MockProvider) GetTargetPortToProtocolMappingForService(arg0 MeshService) (map[uint32]string, error)

GetTargetPortToProtocolMappingForService mocks base method

func (*MockProvider) ListServiceIdentitiesForService added in v0.10.0

func (m *MockProvider) ListServiceIdentitiesForService(arg0 MeshService) ([]identity.ServiceIdentity, error)

ListServiceIdentitiesForService mocks base method

func (*MockProvider) ListServices added in v0.10.0

func (m *MockProvider) ListServices() ([]MeshService, error)

ListServices mocks base method

type MockProviderMockRecorder added in v0.10.0

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

MockProviderMockRecorder is the mock recorder for MockProvider

func (*MockProviderMockRecorder) GetHostnamesForService added in v0.10.0

func (mr *MockProviderMockRecorder) GetHostnamesForService(arg0, arg1 interface{}) *gomock.Call

GetHostnamesForService indicates an expected call of GetHostnamesForService

func (*MockProviderMockRecorder) GetID added in v0.10.0

func (mr *MockProviderMockRecorder) GetID() *gomock.Call

GetID indicates an expected call of GetID

func (*MockProviderMockRecorder) GetPortToProtocolMappingForService added in v0.10.0

func (mr *MockProviderMockRecorder) GetPortToProtocolMappingForService(arg0 interface{}) *gomock.Call

GetPortToProtocolMappingForService indicates an expected call of GetPortToProtocolMappingForService

func (*MockProviderMockRecorder) GetServicesForServiceIdentity added in v0.10.0

func (mr *MockProviderMockRecorder) GetServicesForServiceIdentity(arg0 interface{}) *gomock.Call

GetServicesForServiceIdentity indicates an expected call of GetServicesForServiceIdentity

func (*MockProviderMockRecorder) GetTargetPortToProtocolMappingForService added in v0.10.0

func (mr *MockProviderMockRecorder) GetTargetPortToProtocolMappingForService(arg0 interface{}) *gomock.Call

GetTargetPortToProtocolMappingForService indicates an expected call of GetTargetPortToProtocolMappingForService

func (*MockProviderMockRecorder) ListServiceIdentitiesForService added in v0.10.0

func (mr *MockProviderMockRecorder) ListServiceIdentitiesForService(arg0 interface{}) *gomock.Call

ListServiceIdentitiesForService indicates an expected call of ListServiceIdentitiesForService

func (*MockProviderMockRecorder) ListServices added in v0.10.0

func (mr *MockProviderMockRecorder) ListServices() *gomock.Call

ListServices indicates an expected call of ListServices

type Provider added in v0.10.0

type Provider interface {
	// GetServicesForServiceIdentity retrieves the namespaced services for a given service identity
	GetServicesForServiceIdentity(identity.ServiceIdentity) ([]MeshService, error)

	// ListServices returns a list of services that are part of monitored namespaces
	ListServices() ([]MeshService, error)

	// ListServiceIdentitiesForService returns service identities for given service
	ListServiceIdentitiesForService(MeshService) ([]identity.ServiceIdentity, error)

	// GetPortToProtocolMappingForService returns a mapping of the service's ports to their corresponding application protocol,
	// where the ports returned are the ones used by downstream clients in their requests. This can be different from the ports
	// actually exposed by the application binary, ie. 'spec.ports[].port' instead of 'spec.ports[].targetPort' for a Kubernetes service.
	GetPortToProtocolMappingForService(MeshService) (map[uint32]string, error)

	// GetTargetPortToProtocolMappingForService returns a mapping of the service's ports to their corresponding application protocol.
	// The ports returned are the actual ports on which the application exposes the service derived from the service's endpoints,
	// ie. 'spec.ports[].targetPort' instead of 'spec.ports[].port' for a Kubernetes service.
	GetTargetPortToProtocolMappingForService(MeshService) (map[uint32]string, error)

	// GetHostnamesForService returns a list of hostnames over which the service can be accessed within the local cluster.
	GetHostnamesForService(MeshService, Locality) ([]string, error)

	// GetID returns the unique identifier of the ServiceProvider.
	GetID() string
}

Provider is an interface to be implemented by components abstracting Kubernetes, and other compute/cluster providers

type WeightedCluster

type WeightedCluster struct {
	ClusterName ClusterName `json:"cluster_name:omitempty"`
	Weight      int         `json:"weight:omitempty"`
}

WeightedCluster is a struct of a cluster and is weight that is backing a service

Jump to

Keyboard shortcuts

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