knative

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithMockCluster

func WithMockCluster(block func(mock *MockCluster))

Types

type Application

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

Application representa a Knative application that can be deployed to a cluster.

func (*Application) Deploy

func (app *Application) Deploy(ctx context.Context) (string, error)

func (*Application) DeployDryRun

func (app *Application) DeployDryRun() (string, error)

type Cluster

type Cluster interface {
	SetDryRun()
	SetNoDryRun()
	Namespace() string
	DeployRegistryCredentials() error
	DeployService(service Service) (string, error)
	DeployServices(services []Service) (string, error)
}

func NewCluster

func NewCluster(config Config) (Cluster, error)

type Config

type Config interface {
	Namespace() string  // Kubernetes namespace we want to interact with
	KubeConfig() string // Path to a cluster client config `.kubeconfig`
	Registry() Registry // Main registry we want to pull services from
}

Config is an interface that provides a cluster access details

type Deployer

type Deployer serverless.Deployer

func NewApplicationDeployer

func NewApplicationDeployer(service Service, config Config) (Deployer, error)

func NewFunctionsDeployer

func NewFunctionsDeployer(manifest serverless.Manifest, config Config) (Deployer, error)

type Functions

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

Functions represent a set of Knative services and a root service used to deploy functions to a cluster

func (*Functions) Deploy

func (fn *Functions) Deploy(ctx context.Context) (string, error)

func (*Functions) DeployDryRun

func (fn *Functions) DeployDryRun() (string, error)

func (*Functions) ToServices

func (fn *Functions) ToServices() (services []Service)

type MockCluster

type MockCluster struct {
	mock.Mock
}

func (*MockCluster) DeployRegistryCredentials

func (cluster *MockCluster) DeployRegistryCredentials() error

func (*MockCluster) DeployService

func (cluster *MockCluster) DeployService(service Service) (string, error)

func (*MockCluster) DeployServices

func (cluster *MockCluster) DeployServices(services []Service) (string, error)

func (*MockCluster) Namespace

func (cluster *MockCluster) Namespace() string

func (*MockCluster) SetDryRun

func (cluster *MockCluster) SetDryRun()

func (*MockCluster) SetNoDryRun

func (cluster *MockCluster) SetNoDryRun()

type MockConfig

type MockConfig struct {
	mock.Mock
}

func (*MockConfig) KubeConfig

func (config *MockConfig) KubeConfig() string

func (*MockConfig) Namespace

func (config *MockConfig) Namespace() string

func (*MockConfig) Registry

func (config *MockConfig) Registry() Registry

type Registry

type Registry struct {
	Host       string // Repository hostname
	Username   string // Access username
	Password   string // Access password
	Repository string // Default repository (includes the hostname)
}

Registry represents Knative entry describing a container registry

func (Registry) HasCredentials

func (registry Registry) HasCredentials() bool

type Service

type Service struct {
	Name        string
	Image       string
	Namespace   string
	Secrets     []string
	Labels      []string
	Envs        map[string]string
	Annotations map[string]string
}

Service describes a basic Knative service that can be deployed to a Knative cluster and served by Knative Serving

Jump to

Keyboard shortcuts

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