driver

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigMapDriverName = "ConfigMap"

ConfigMapDriverName is local storage driver name

View Source
const LocalDriverName = "Local"

LocalDriverName is local storage driver name

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	*appfile.AppFile `json:",inline"`
	Tm               template.Manager
}

Application is an implementation level object for Appfile, all vela commands will access AppFile from Appliction struct here.

func NewApplication

func NewApplication(f *appfile.AppFile, tm template.Manager) *Application

NewApplication will create application object

func (*Application) Validate

func (app *Application) Validate() error

Validate will validate whether an Appfile is valid.

type ConfigMap

type ConfigMap struct {
	Driver
}

ConfigMap Storage

func NewConfigMapStorage

func NewConfigMapStorage() *ConfigMap

NewConfigMapStorage get storage client of ConfigMap type

func (*ConfigMap) Delete

func (c *ConfigMap) Delete(envName, appName string) error

Delete applications from configmap storage

func (*ConfigMap) Get

func (c *ConfigMap) Get(envName, appName string) (*Application, error)

Get applications from configmap storage

func (*ConfigMap) List

func (c *ConfigMap) List(envName string) ([]*Application, error)

List applications from configmap storage

func (*ConfigMap) Name

func (c *ConfigMap) Name() string

Name of local storage

func (*ConfigMap) Save

func (c *ConfigMap) Save(app *Application, envName string) error

Save applications from configmap storage

type Driver

type Driver interface {
	// List applications
	List(envName string) ([]*Application, error)
	// Save application
	Save(app *Application, envName string) error
	// Delete application
	Delete(envName, appName string) error
	// Get application
	Get(envName, appName string) (*Application, error)
	// Name of storage driver
	Name() string
}

Driver is mutli implement interface

type Local

type Local struct {
	Driver
}

Local Storage

func NewLocalStorage

func NewLocalStorage() *Local

NewLocalStorage get storage client of Local type

func (*Local) Delete

func (l *Local) Delete(envName, appName string) error

Delete application from local storage

func (*Local) Get

func (l *Local) Get(envName, appName string) (*Application, error)

Get application from local storage

func (*Local) List

func (l *Local) List(envName string) ([]*Application, error)

List applications from local storage

func (*Local) Name

func (l *Local) Name() string

Name is local storage driver name

func (*Local) Save

func (l *Local) Save(app *Application, envName string) error

Save application from local storage

Jump to

Keyboard shortcuts

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