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 ¶
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
Click to show internal directories.
Click to hide internal directories.