storages

package
v0.13.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrReleaseNotExist     = errors.New("release does not exist")
	ErrReleaseAlreadyExist = errors.New("release has already existed")
)

Functions

func GenGenericOssReleasePrefixKey

func GenGenericOssReleasePrefixKey(prefix, project, workspace string) string

GenGenericOssReleasePrefixKey generates generic oss release prefix, which is use for OssStorage and S3Storage.

func GenReleaseDirPath

func GenReleaseDirPath(dir, project, workspace string) string

GenReleaseDirPath generates the release dir path, which is used for LocalStorage.

func GenReleasePrefixKeyWithPath added in v0.13.0

func GenReleasePrefixKeyWithPath(prefix, path string) string

GenReleasePrefixKeyWithPath generates oss state file key with cloud and env instead of workspace, which is use for OssStorage and S3Storage.

Types

type LocalStorage

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

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

func NewLocalStorage

func NewLocalStorage(path string) (*LocalStorage, error)

NewLocalStorage news local release storage, and derives metadata.

func (*LocalStorage) Create

func (s *LocalStorage) Create(r *v1.Release) error

func (*LocalStorage) Get

func (s *LocalStorage) Get(revision uint64) (*v1.Release, error)

func (*LocalStorage) GetLatestRevision

func (s *LocalStorage) GetLatestRevision() uint64

func (*LocalStorage) GetRevisions

func (s *LocalStorage) GetRevisions() []uint64

func (*LocalStorage) GetStackBoundRevisions

func (s *LocalStorage) GetStackBoundRevisions(stack string) []uint64

func (*LocalStorage) Update

func (s *LocalStorage) Update(r *v1.Release) error

type OssStorage

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

OssStorage is an implementation of release.Storage which uses oss as storage.

func NewOssStorage

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

NewOssStorage news oss release storage, and derives metadata.

func (*OssStorage) Create

func (s *OssStorage) Create(r *v1.Release) error

func (*OssStorage) Get

func (s *OssStorage) Get(revision uint64) (*v1.Release, error)

func (*OssStorage) GetLatestRevision

func (s *OssStorage) GetLatestRevision() uint64

func (*OssStorage) GetRevisions

func (s *OssStorage) GetRevisions() []uint64

func (*OssStorage) GetStackBoundRevisions

func (s *OssStorage) GetStackBoundRevisions(stack string) []uint64

func (*OssStorage) Update

func (s *OssStorage) Update(r *v1.Release) error

type S3Storage

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

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

func NewS3Storage

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

NewS3Storage news s3 release storage, and derives metadata.

func (*S3Storage) Create

func (s *S3Storage) Create(r *v1.Release) error

func (*S3Storage) Get

func (s *S3Storage) Get(revision uint64) (*v1.Release, error)

func (*S3Storage) GetLatestRevision

func (s *S3Storage) GetLatestRevision() uint64

func (*S3Storage) GetRevisions

func (s *S3Storage) GetRevisions() []uint64

func (*S3Storage) GetStackBoundRevisions

func (s *S3Storage) GetStackBoundRevisions(stack string) []uint64

func (*S3Storage) Update

func (s *S3Storage) Update(r *v1.Release) error

Jump to

Keyboard shortcuts

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