service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 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

	// Port is the port number that clients use to access the service.
	// This can be different than MeshService.TargetPort which represents the actual port number
	// the application is accepting connections on.
	// Port maps to ServicePort.Port in k8s: https://pkg.go.dev/k8s.io/api/core/v1#ServicePort
	Port uint16

	// TargetPort is the port number on which an application accept traffic directed to this MeshService
	// This can be different than MeshService.Port in k8s.
	// TargetPort maps to ServicePort.TargetPort in k8s: https://pkg.go.dev/k8s.io/api/core/v1#ServicePort
	TargetPort uint16

	// Protocol is the protocol served by the service's port
	Protocol string
}

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

func (MeshService) EnvoyClusterName added in v0.11.0

func (ms MeshService) EnvoyClusterName() string

EnvoyClusterName is the name of the cluster corresponding to the MeshService in Envoy

func (MeshService) EnvoyLocalClusterName added in v0.11.0

func (ms MeshService) EnvoyLocalClusterName() string

EnvoyLocalClusterName is the name of the local cluster corresponding to the MeshService in Envoy

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) 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

String returns the string representation of the given MeshService

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) GetID added in v0.10.0

func (m *MockProvider) GetID() string

GetID mocks base method.

func (*MockProvider) GetServicesForServiceIdentity added in v0.10.0

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

GetServicesForServiceIdentity mocks base method.

func (*MockProvider) ListServiceIdentitiesForService added in v0.10.0

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

ListServiceIdentitiesForService mocks base method.

func (*MockProvider) ListServices added in v0.10.0

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

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) GetID added in v0.10.0

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

GetID indicates an expected call of GetID.

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) 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

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

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

	// GetID returns the unique identifier of the Provider
	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