appmanager

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const NoOpToken = "no-op-token"

Variables

View Source
var NoOpTokenManager = noopTokenManager{}

NoOpTokenManager is a singleton instance of a do-nothing token manager.

Functions

This section is empty.

Types

type AuthStore

type AuthStore interface {
	ContextForNamespace(baseCtx context.Context, namespace string) (context.Context, error)
	RemoveAllCreatedTokens(ctx context.Context) ([]string, error)
}

AuthStore manages authorized contexts for AppManager API calls on a per-vpnamespace basis.

func NewAuthStore

func NewAuthStore(tokenManager TokenManager) AuthStore

type Client

type Client interface {
	DeploymentTargets() DeploymentTargetsService
	Events() EventsService
	Deployments() DeploymentsService
	Savepoints() SavepointsService
}

Client is a simple interface to expose the various resources of the VVP AppManager

func NewClient

func NewClient(config *appmanagerapi.Configuration, authStore AuthStore) Client

type DeploymentTargetsService

type DeploymentTargetsService interface {
	GetDeploymentTarget(ctx context.Context, namespaceName, name string) (*appmanagerapi.DeploymentTarget, error)
	CreateDeploymentTarget(ctx context.Context, namespaceName string, depTarget appmanagerapi.DeploymentTarget) (*appmanagerapi.DeploymentTarget, error)
	DeleteDeploymentTarget(ctx context.Context, namespaceName, name string) (*appmanagerapi.DeploymentTarget, error)
}

type DeploymentsService

type DeploymentsService interface {
	GetDeployment(ctx context.Context, namespaceName, id string) (*appmanagerapi.Deployment, error)
	ListDeployments(ctx context.Context, namespaceName string) (*appmanagerapi.ResourceListOfDeployment, error)
	GetDeploymentByName(ctx context.Context, namespaceName, name string) (*appmanagerapi.Deployment, error)
	CreateDeployment(ctx context.Context, namespaceName string, dep appmanagerapi.Deployment) (*appmanagerapi.Deployment, error)
	UpdateDeployment(ctx context.Context, namespaceName, id string, dep appmanagerapi.Deployment) (*appmanagerapi.Deployment, error)
	DeleteDeployment(ctx context.Context, namespaceName, id string) (*appmanagerapi.Deployment, error)
}

type EventsService

type EventsService interface {
	GetEvents(ctx context.Context, namespaceName string, opts *GetEventsOpts) (*appmanagerapi.ResourceListOfEvent, error)
}

type GetEventsOpts

type GetEventsOpts struct {
	DeploymentID optional.Interface
	JobID        optional.Interface
}

type SavepointsService

type SavepointsService interface {
	GetSavepoint(ctx context.Context, namespaceName, id string) (*appmanagerapi.Savepoint, error)
	CreateSavepoint(ctx context.Context, namespaceName string, savepoint appmanagerapi.Savepoint) (*appmanagerapi.Savepoint, error)
}

type TokenData

type TokenData struct {
	Name string
	// contains filtered or unexported fields
}

TokenData wraps an API token

type TokenManager

type TokenManager interface {
	// TokenExists checks if a token exists in a namespace by name
	TokenExists(ctx context.Context, namespaceName, name string) (bool, error)
	// CreateToken creates a token under a namespace with a given role and returns the secret
	CreateToken(ctx context.Context, namespaceName, name, role string) (string, error)
	// RemoveToken deletes a token from a namespace and returns whether it existed
	RemoveToken(ctx context.Context, namespaceName, name string) (bool, error)
}

TokenManager handles the API token lifecycle.

Jump to

Keyboard shortcuts

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