backend

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackendFromConfig

func BackendFromConfig(config *Storage, override BackendOps, dir string) (states.StateStorage, error)

BackendFromConfig return stateStorage, this func handler backend config merge and configure backend. return a StateStorage to manage State

func MergeConfig

func MergeConfig(config, override map[string]interface{}) map[string]interface{}

MergeConfig merge project backend config and cli backend config

Types

type BackendOps

type BackendOps struct {
	// Config is a series of backend configurations,
	// such as ["path=kusion_state.json"]
	Config []string

	// Type is the type of backend, currently supported:
	//    local - state is stored to a local file
	//    db 	- state is stored to db
	//    oss 	- state is stored to aliyun oss
	//    s3 	- state is stored to aws s3
	Type string
}

BackendOps kusion cli backend override config

func (*BackendOps) AddBackendFlags

func (o *BackendOps) AddBackendFlags(cmd *cobra.Command)

type Storage

type Storage struct {
	Type   string                 `json:"storageType,omitempty" yaml:"storageType,omitempty"`
	Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
}

backend config state storage type

func NewDefaultBackend

func NewDefaultBackend(dir string, fileName string) *Storage

NewDefalutBackend return defalut backend. default backend is local filesystem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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