service

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: BSD-3-Clause Imports: 29 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	AuthScheme = "Bearer"
)

AuthScheme to be used in the Authorization header

Variables

View Source
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

type APIContext struct {
	echo.Context
	// contains filtered or unexported fields
}

APIContext is a custom echo context

type APIImpl

type APIImpl struct {
	// contains filtered or unexported fields
}

APIImpl implements the API interface

func (*APIImpl) CreateCluster

func (s *APIImpl) CreateCluster(c echo.Context) error

CreateCluster creates a new cluster

func (*APIImpl) CreateTenant

func (s *APIImpl) CreateTenant(c echo.Context) error

CreateTenant creates a new tenant

func (*APIImpl) DeleteCluster

func (s *APIImpl) DeleteCluster(c echo.Context, clusterID api.ClusterIdParameter) error

DeleteCluster deletes a cluster

func (*APIImpl) DeleteTenant

func (s *APIImpl) DeleteTenant(c echo.Context, tenantID api.TenantIdParameter) error

DeleteTenant deletes a tenant

func (*APIImpl) Docs added in v0.1.2

func (s *APIImpl) Docs(ctx echo.Context) error

Docs serves the swagger UI

func (*APIImpl) GetCluster

func (s *APIImpl) GetCluster(c echo.Context, clusterID api.ClusterIdParameter) error

GetCluster gets a cluster

func (*APIImpl) GetTenant

func (s *APIImpl) GetTenant(c echo.Context, tenantID api.TenantIdParameter) error

GetTenant gets a tenant

func (*APIImpl) Healthz

func (s *APIImpl) Healthz(ctx echo.Context) error

Healthz implements the API health check

func (*APIImpl) InstallSteward

func (s *APIImpl) InstallSteward(c echo.Context, params api.InstallStewardParams) error

InstallSteward returns the JSON to install Steward on a cluster

func (*APIImpl) ListClusters

func (s *APIImpl) ListClusters(c echo.Context, params api.ListClustersParams) error

ListClusters lists all clusters

func (*APIImpl) ListTenants

func (s *APIImpl) ListTenants(c echo.Context) error

ListTenants lists all tenants

func (*APIImpl) Openapi added in v0.1.2

func (s *APIImpl) Openapi(ctx echo.Context) error

Openapi serves the JSON spec

func (*APIImpl) QueryInventory

func (s *APIImpl) QueryInventory(ctx echo.Context, params api.QueryInventoryParams) error

QueryInventory queries the inventory

func (*APIImpl) UpdateCluster

func (s *APIImpl) UpdateCluster(c echo.Context, clusterID api.ClusterIdParameter) error

UpdateCluster updates a cluster

func (*APIImpl) UpdateInventory

func (s *APIImpl) UpdateInventory(ctx echo.Context) error

UpdateInventory updates an inventory entry

func (*APIImpl) UpdateTenant

func (s *APIImpl) UpdateTenant(c echo.Context, tenantID api.TenantIdParameter) error

UpdateTenant udpates a tenant

type KubernetesAuth

type KubernetesAuth struct {
	CreateClientFunc func(string) (client.Client, error)
}

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

Jump to

Keyboard shortcuts

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