cluster

package
v0.0.0-...-bf90f01 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: Apache-2.0 Imports: 15 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WhoAmI

func WhoAmI(ctx context.Context, clusterURL string, token string, clientOptions ...configuration.HTTPClientOption) (string, error)

WhoAmI checks with OSO who owns the current token. returns the username

Types

type Cluster

type Cluster struct {
	APIURL            string
	ConsoleURL        string
	MetricsURL        string
	LoggingURL        string
	AppDNS            string
	CapacityExhausted bool

	User  string
	Token string
}

Cluster a cluster

type ForType

type ForType func(envType environment.Type) Cluster

ForType returns a cluster assigned for the given environment type

func ForTypeMapping

func ForTypeMapping(mapping map[environment.Type]Cluster) ForType

ForTypeMapping takes the given map and wraps it by the ForType function that returns values from the map based on the keys

type GetCluster

type GetCluster func(ctx context.Context, target string) (Cluster, error)

GetCluster returns a cluster for the given target if it is one of the clusters assigned to the user stored in the given context, error otherwise

type Service

type Service interface {
	GetCluster(ctx context.Context, target string) (Cluster, error)
	GetClusters(ctx context.Context) []Cluster
	GetUserClusterForType(ctx context.Context, user *auth.User) (ForType, error)
	Start() error
	Stop()
}

Service the interface for the cluster service

func NewClusterService

func NewClusterService(refreshInt time.Duration, authService auth.Service, options ...configuration.HTTPClientOption) Service

NewClusterService creates an instance of service that using the Auth service retrieves information about clusters

type Stats

type Stats struct {
	CacheHits      int
	CacheMissed    int
	CacheRefreshes int
}

Stats some stats about the cached data, for verifying during the tests, at first.

Jump to

Keyboard shortcuts

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