Documentation ¶
Index ¶
- Constants
- Variables
- func GenGenericOssWorkspacePrefixKey(prefix string) string
- func GenWorkspaceDirPath(dir string) string
- type LocalStorage
- func (s *LocalStorage) Create(ws *v1.Workspace) error
- func (s *LocalStorage) Delete(name string) error
- func (s *LocalStorage) Get(name string) (*v1.Workspace, error)
- func (s *LocalStorage) GetCurrent() (string, error)
- func (s *LocalStorage) GetNames() ([]string, error)
- func (s *LocalStorage) SetCurrent(name string) error
- func (s *LocalStorage) Update(ws *v1.Workspace) error
- type OssStorage
- func (s *OssStorage) Create(ws *v1.Workspace) error
- func (s *OssStorage) Delete(name string) error
- func (s *OssStorage) Get(name string) (*v1.Workspace, error)
- func (s *OssStorage) GetCurrent() (string, error)
- func (s *OssStorage) GetNames() ([]string, error)
- func (s *OssStorage) SetCurrent(name string) error
- func (s *OssStorage) Update(ws *v1.Workspace) error
- type S3Storage
- func (s *S3Storage) Create(ws *v1.Workspace) error
- func (s *S3Storage) Delete(name string) error
- func (s *S3Storage) Get(name string) (*v1.Workspace, error)
- func (s *S3Storage) GetCurrent() (string, error)
- func (s *S3Storage) GetNames() ([]string, error)
- func (s *S3Storage) SetCurrent(name string) error
- func (s *S3Storage) Update(ws *v1.Workspace) error
Constants ¶
View Source
const (
DefaultWorkspace = "default"
)
Variables ¶
View Source
var ( ErrWorkspaceNotExist = errors.New("workspace does not exist") ErrWorkspaceAlreadyExist = errors.New("workspace has already existed") )
Functions ¶
func GenGenericOssWorkspacePrefixKey ¶
GenGenericOssWorkspacePrefixKey generates generic oss workspace prefix key, which is use for OssStorage and S3Storage.
func GenWorkspaceDirPath ¶
GenWorkspaceDirPath generates the workspace directory path, which is used for LocalStorage.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
// contains filtered or unexported fields
}
LocalStorage is an implementation of workspace.Storage which uses local filesystem as storage.
func NewLocalStorage ¶
func NewLocalStorage(path string) (*LocalStorage, error)
NewLocalStorage news local workspace storage and init default workspace.
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(name string) error
func (*LocalStorage) GetCurrent ¶
func (s *LocalStorage) GetCurrent() (string, error)
func (*LocalStorage) GetNames ¶
func (s *LocalStorage) GetNames() ([]string, error)
func (*LocalStorage) SetCurrent ¶
func (s *LocalStorage) SetCurrent(name string) error
type OssStorage ¶
type OssStorage struct {
// contains filtered or unexported fields
}
OssStorage is an implementation of workspace.Storage which uses oss as storage.
func NewOssStorage ¶
func NewOssStorage(bucket *oss.Bucket, prefix string) (*OssStorage, error)
NewOssStorage news oss workspace storage and init default workspace.
func (*OssStorage) Delete ¶
func (s *OssStorage) Delete(name string) error
func (*OssStorage) GetCurrent ¶
func (s *OssStorage) GetCurrent() (string, error)
func (*OssStorage) GetNames ¶
func (s *OssStorage) GetNames() ([]string, error)
func (*OssStorage) SetCurrent ¶
func (s *OssStorage) SetCurrent(name string) error
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage is an implementation of workspace.Storage which uses s3 as storage.
func NewS3Storage ¶
NewS3Storage news s3 workspace storage and init default workspace.
func (*S3Storage) GetCurrent ¶
func (*S3Storage) SetCurrent ¶
Click to show internal directories.
Click to hide internal directories.