integrations

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SanitizeName

func SanitizeName(original string) string

SanitizeName takes a string and returns a URI acceptable name e.g. Test Service would become test-service

Types

type Integration

type Integration interface {
	// Register a new service with the integration, this is used when exposing a local
	// application to a remote cluster
	Register(id string, name string, srcPort, dstPort int) error
	// Deregister a new service with the integration, this is used when exposing a local
	// application to a remote cluster
	Deregister(id string) error
	// LookupAddress, allows a service name to be resolved to a physical address
	// where the service name is already addressable (i.e. kubernetes, or local)
	// this method should just return the original service
	LookupAddress(service string) (string, error)
}

Integration defines the base interface which implementations like Consul or Istio implement

type Mock

type Mock struct {
	mock.Mock
}

Mock defines a mock integration which can be used in tests

func (*Mock) Deregister

func (m *Mock) Deregister(id string) error

Deregister satisfies the Integration interface

func (*Mock) LookupAddress

func (m *Mock) LookupAddress(service string) (string, error)

func (*Mock) Register

func (m *Mock) Register(id string, name string, srcPort, dstPort int) error

Register satisfies the Integration interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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