storages

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyMysqlDBName     = errors.New("empty db name")
	ErrEmptyMysqlUser       = errors.New("empty mysql db user")
	ErrEmptyMysqlHost       = errors.New("empty mysql host")
	ErrInvalidMysqlPort     = errors.New("mysql port must be between 1 and 65535")
	ErrEmptyBucket          = errors.New("empty bucket")
	ErrEmptyAccessKeyID     = errors.New("empty access key id")
	ErrEmptyAccessKeySecret = errors.New("empty access key secret")
	ErrEmptyOssEndpoint     = errors.New("empty oss endpoint")
	ErrEmptyS3Region        = errors.New("empty s3 region")
)

Functions

func CompleteLocalConfig

func CompleteLocalConfig(config *v1.BackendLocalConfig) error

CompleteLocalConfig sets default value of path if not set, which uses the path of kusion data folder.

func CompleteMysqlConfig

func CompleteMysqlConfig(config *v1.BackendMysqlConfig)

CompleteMysqlConfig sets default value of port if not set, which is 3306, and fulfills password from environment variables if set.

func CompleteOssConfig

func CompleteOssConfig(config *v1.BackendOssConfig)

CompleteOssConfig fulfills the whole oss config from environment variables if set.

func CompleteS3Config

func CompleteS3Config(config *v1.BackendS3Config)

CompleteS3Config fulfills the whole s3 config from environment variables if set.

func ValidateMysqlConfig

func ValidateMysqlConfig(config *v1.BackendMysqlConfig) error

ValidateMysqlConfig is used to validate the v1.BackendMysqlConfig is valid or not. If valid, the config contains all valid items to new a mysql DB.

func ValidateMysqlConfigFromFile

func ValidateMysqlConfigFromFile(config *v1.BackendMysqlConfig) error

ValidateMysqlConfigFromFile is used to validate the v1.BackendMysqlConfig parsed from config file is valid or not, where the sensitive data items set as environment variables are not included.

func ValidateOssConfig

func ValidateOssConfig(config *v1.BackendOssConfig) error

ValidateOssConfig is used to validate v1.BackendOssConfig is valid or not, where all the items are included. If valid, the config contains all valid items to new an oss client.

func ValidateOssConfigFromFile

func ValidateOssConfigFromFile(config *v1.BackendOssConfig) error

ValidateOssConfigFromFile is used to validate the v1.BackendOssConfig parsed from config file is valid or not, where the sensitive data items set as environment variables are not included.

func ValidateS3Config

func ValidateS3Config(config *v1.BackendS3Config) error

ValidateS3Config is used to validate s3Config is valid or not, where all the items are included. If valid, the config contains all valid items to new a s3 client.

func ValidateS3ConfigFromFile

func ValidateS3ConfigFromFile(config *v1.BackendS3Config) error

ValidateS3ConfigFromFile is used to validate the v1.BackendS3Config parsed from config file is valid or not, where the sensitive data items set as environment variables are not included.

Types

type LocalStorage

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

LocalStorage is an implementation of backend.Backend which uses local filesystem as storage.

func NewLocalStorage

func NewLocalStorage(config *v1.BackendLocalConfig) *LocalStorage

func (*LocalStorage) SpecStorage

func (s *LocalStorage) SpecStorage(project, stack, workspace string) spec.Storage

func (*LocalStorage) StateStorage

func (s *LocalStorage) StateStorage(project, stack, workspace string) state.Storage

func (*LocalStorage) WorkspaceStorage

func (s *LocalStorage) WorkspaceStorage() (workspace.Storage, error)

type MysqlStorage

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

MysqlStorage is an implementation of backend.Backend which uses mysql as storage.

func NewMysqlStorage

func NewMysqlStorage(config *v1.BackendMysqlConfig) (*MysqlStorage, error)

func (*MysqlStorage) SpecStorage

func (s *MysqlStorage) SpecStorage(project, stack, workspace string) spec.Storage

func (*MysqlStorage) StateStorage

func (s *MysqlStorage) StateStorage(project, stack, workspace string) state.Storage

func (*MysqlStorage) WorkspaceStorage

func (s *MysqlStorage) WorkspaceStorage() (workspace.Storage, error)

type OssStorage

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

OssStorage is an implementation of backend.Backend which uses oss as storage.

func NewOssStorage

func NewOssStorage(config *v1.BackendOssConfig) (*OssStorage, error)

func (*OssStorage) SpecStorage

func (s *OssStorage) SpecStorage(project, stack, workspace string) spec.Storage

func (*OssStorage) StateStorage

func (s *OssStorage) StateStorage(project, stack, workspace string) state.Storage

func (*OssStorage) WorkspaceStorage

func (s *OssStorage) WorkspaceStorage() (workspace.Storage, error)

type S3Storage

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

S3Storage is an implementation of backend.Backend which uses s3 as storage.

func NewS3Storage

func NewS3Storage(config *v1.BackendS3Config) (*S3Storage, error)

func (*S3Storage) SpecStorage

func (s *S3Storage) SpecStorage(project, stack, workspace string) spec.Storage

func (*S3Storage) StateStorage

func (s *S3Storage) StateStorage(project, stack, workspace string) state.Storage

func (*S3Storage) WorkspaceStorage

func (s *S3Storage) WorkspaceStorage() (workspace.Storage, error)

Jump to

Keyboard shortcuts

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