storages

package
v0.12.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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 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 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) ReleaseStorage added in v0.12.0

func (s *LocalStorage) ReleaseStorage(project, workspace string) (release.Storage, error)

func (*LocalStorage) WorkspaceStorage

func (s *LocalStorage) 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) ReleaseStorage added in v0.12.0

func (s *OssStorage) ReleaseStorage(project, workspace string) (release.Storage, error)

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) ReleaseStorage added in v0.12.0

func (s *S3Storage) ReleaseStorage(project, workspace string) (release.Storage, error)

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