util

package
v0.16.5-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShuttingDown = errors.New("shutting down")
)

Functions

func AllHostnamesOfManifestGroup added in v0.9.3

func AllHostnamesOfManifestGroup(mgroup manifest.Group) []string

func ApplyToContext added in v0.14.0

func ApplyToContext(ctx context.Context, config map[interface{}]interface{}) context.Context

func ComputeCommittedResources added in v0.9.3

func ComputeCommittedResources(factor float64, rv atypes.ResourceValue) atypes.ResourceValue

func ExposeExternalPort

func ExposeExternalPort(expose manifest.ServiceExpose) int32

func GetEndpointQuantityOfResourceGroup

func GetEndpointQuantityOfResourceGroup(resources atypes.ResourceGroup, kind atypes.Endpoint_Kind) uint

func GetEndpointQuantityOfResourceUnits

func GetEndpointQuantityOfResourceUnits(r atypes.ResourceUnits, kind atypes.Endpoint_Kind) uint

func IngressHost added in v0.14.0

func IngressHost(lid mtypes.LeaseID, svcName string) string

func IsInsideKubernetes

func IsInsideKubernetes() (bool, error)

func LeaseIDToNamespace added in v0.14.0

func LeaseIDToNamespace(lid mtypes.LeaseID) string

LeaseIDToNamespace generates a unique sha256 sum for identifying a provider's object name.

func MakeIPSharingKey

func MakeIPSharingKey(lID mtypes.LeaseID, endpointName string) string

func ShouldBeIngress

func ShouldBeIngress(expose manifest.ServiceExpose) bool

Types

type ServiceClient

type ServiceClient interface {
	CreateRequest(ctx context.Context, method, path string, body io.Reader) (*http.Request, error)
	DoRequest(req *http.Request) (*http.Response, error)
}

type ServiceDiscoveryAgent

type ServiceDiscoveryAgent interface {
	Stop()
	GetClient(ctx context.Context, isHTTPS, secure bool) (ServiceClient, error)
	DiscoverNow()
}

func NewServiceDiscoveryAgent

func NewServiceDiscoveryAgent(logger log.Logger, kubeConfig *rest.Config, portName, serviceName, namespace string, endpoint *net.SRV) (ServiceDiscoveryAgent, error)

Jump to

Keyboard shortcuts

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