Documentation
¶
Index ¶
- Constants
- Variables
- func NewAPIServer(k8sMiddleware ...KubernetesAuth) (*echo.Echo, error)
- type APIContext
- type APIImpl
- func (s *APIImpl) CreateCluster(c echo.Context) error
- func (s *APIImpl) CreateTenant(c echo.Context) error
- func (s *APIImpl) DeleteCluster(c echo.Context, clusterID api.ClusterIdParameter) error
- func (s *APIImpl) DeleteTenant(c echo.Context, tenantID api.TenantIdParameter) error
- func (s *APIImpl) Docs(ctx echo.Context) error
- func (s *APIImpl) GetCluster(c echo.Context, clusterID api.ClusterIdParameter) error
- func (s *APIImpl) GetTenant(c echo.Context, tenantID api.TenantIdParameter) error
- func (s *APIImpl) Healthz(ctx echo.Context) error
- func (s *APIImpl) InstallSteward(c echo.Context, params api.InstallStewardParams) error
- func (s *APIImpl) ListClusters(c echo.Context, params api.ListClustersParams) error
- func (s *APIImpl) ListTenants(c echo.Context) error
- func (s *APIImpl) Openapi(ctx echo.Context) error
- func (s *APIImpl) QueryInventory(ctx echo.Context, params api.QueryInventoryParams) error
- func (s *APIImpl) UpdateCluster(c echo.Context, clusterID api.ClusterIdParameter) error
- func (s *APIImpl) UpdateInventory(ctx echo.Context) error
- func (s *APIImpl) UpdateTenant(c echo.Context, tenantID api.TenantIdParameter) error
- type KubernetesAuth
Constants ¶
const ( // LieutenantInstanceFact defines the name of the fact which specifies the Lieutenant instance // a cluster was created on LieutenantInstanceFact = "lieutenant-instance" // LieutenantInstanceFactEnvVar is the env var name that's used to get the instance name LieutenantInstanceFactEnvVar = "LIEUTENANT_INSTANCE" )
const (
AuthScheme = "Bearer"
)
AuthScheme to be used in the Authorization header
Variables ¶
var DefaultKubernetesAuth = &KubernetesAuth{
CreateClientFunc: getClientFromToken,
}
DefaultKubernetesAuth uses the JWT bearer token to authenticate
Functions ¶
func NewAPIServer ¶
func NewAPIServer(k8sMiddleware ...KubernetesAuth) (*echo.Echo, error)
NewAPIServer instantiates a new Echo API server
Types ¶
type APIContext ¶
APIContext is a custom echo context
type APIImpl ¶
type APIImpl struct {
// contains filtered or unexported fields
}
APIImpl implements the API interface
func (*APIImpl) CreateCluster ¶
CreateCluster creates a new cluster
func (*APIImpl) CreateTenant ¶
CreateTenant creates a new tenant
func (*APIImpl) DeleteCluster ¶
DeleteCluster deletes a cluster
func (*APIImpl) DeleteTenant ¶
DeleteTenant deletes a tenant
func (*APIImpl) GetCluster ¶
GetCluster gets a cluster
func (*APIImpl) InstallSteward ¶
InstallSteward returns the JSON to install Steward on a cluster
func (*APIImpl) ListClusters ¶
ListClusters lists all clusters
func (*APIImpl) ListTenants ¶
ListTenants lists all tenants
func (*APIImpl) QueryInventory ¶
QueryInventory queries the inventory
func (*APIImpl) UpdateCluster ¶
UpdateCluster updates a cluster
func (*APIImpl) UpdateInventory ¶
UpdateInventory updates an inventory entry
func (*APIImpl) UpdateTenant ¶
UpdateTenant udpates a tenant
type KubernetesAuth ¶
KubernetesAuth provides middleware to authenticate with Kubernetes JWT tokens
func (*KubernetesAuth) JWTAuth ¶
func (k *KubernetesAuth) JWTAuth(next echo.HandlerFunc) echo.HandlerFunc
JWTAuth makes sure a JWT bearer token is provided and creates a Kubernetes client