cluster

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Providers

func Providers() []string

Providers returns a sorted list of the names of the registered providers.

func Register

func Register(name string, provider Provider)

Register makes a provider available by the provided name. If Register is called twice with the same name or if provider is nil, it panics.

Types

type Cluster

type Cluster struct {
	v1.Cluster
	ClusterCredential v1.ClusterCredential
}

Cluster wrap cluster and it's credential

type InternalCluster

type InternalCluster struct {
	platform.Cluster
	ClusterCredential platform.ClusterCredential
}

InternalCluster wrap internal version cluster and it's credential

type Provider

type Provider interface {
	Name() string

	ValidateCredential(cluster InternalCluster) (field.ErrorList, error)

	Validate(cluster platform.Cluster) (field.ErrorList, error)
	PreCreate(user UserInfo, cluster platform.Cluster) (platform.Cluster, error)
	AfterCreate(cluster platform.Cluster) ([]interface{}, error)
	ValidateUpdate(cluster platform.Cluster, oldCluster platform.Cluster) (field.ErrorList, error)

	OnInitialize(cluster Cluster) (Cluster, error)
	OnUpdate(cluster Cluster) (Cluster, error)
	OnDelete(cluster v1.Cluster) error
}

Provider defines a set of response interfaces for specific cluster types in cluster management.

func GetProvider

func GetProvider(name string) (Provider, error)

GetProvider returns provider by name

type UserInfo

type UserInfo struct {
	// Name returns the name that uniquely identifies this user among all
	// other active users.
	Name string
	// Groups returns the names of the groups the user is a member of
	Groups []string
	// GetExtra can contain any additional information that the authenticator
	// thought was interesting.  One example would be scopes on a token.
	// Keys in this map should be namespaced to the authenticator or
	// authenticator/authorizer pair making use of them.
	Extra map[string][]string
}

UserInfo describes a user that has been authenticated to the system.

Jump to

Keyboard shortcuts

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