storages

package
v0.11.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenGenericOssStateFileKey

func GenGenericOssStateFileKey(prefix, project, workspace string) string

GenGenericOssStateFileKey generates generic oss state file key, which is use for OssStorage and S3Storage.

func GenStateFilePath

func GenStateFilePath(dir, project, workspace string) string

GenStateFilePath generates the state file path, which is used for LocalStorage.

Types

type LocalStorage

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

LocalStorage is an implementation of state.Storage which uses local filesystem as storage.

func NewLocalStorage

func NewLocalStorage(path string) *LocalStorage

func (*LocalStorage) Apply

func (s *LocalStorage) Apply(state *v1.DeprecatedState) error

func (*LocalStorage) Get

func (s *LocalStorage) Get() (*v1.DeprecatedState, error)

type MysqlStorage

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

MysqlStorage is an implementation of state.Storage which uses mysql as storage.

func NewMysqlStorage

func NewMysqlStorage(db *gorm.DB, project, workspace string) *MysqlStorage

func (*MysqlStorage) Apply

func (s *MysqlStorage) Apply(state *v1.DeprecatedState) error

func (*MysqlStorage) Get

func (s *MysqlStorage) Get() (*v1.DeprecatedState, error)

type OssStorage

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

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

func NewOssStorage

func NewOssStorage(bucket *oss.Bucket, key string) *OssStorage

func (*OssStorage) Apply

func (s *OssStorage) Apply(state *v1.DeprecatedState) error

func (*OssStorage) Get

func (s *OssStorage) Get() (*v1.DeprecatedState, error)

type S3Storage

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

S3Storage is an implementation of state.Storage which uses s3 as storage.

func NewS3Storage

func NewS3Storage(s3 *s3.S3, bucket, key string) *S3Storage

func (*S3Storage) Apply

func (s *S3Storage) Apply(state *v1.DeprecatedState) error

func (*S3Storage) Get

func (s *S3Storage) Get() (*v1.DeprecatedState, error)

type StateMysqlDO

type StateMysqlDO struct {
	Project   string
	Workspace string
	Content   string
}

StateMysqlDO is the data object stored in the mysql db.

func (StateMysqlDO) TableName

func (s StateMysqlDO) TableName() string

Jump to

Keyboard shortcuts

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