Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrGraphNotExist = errors.New("graph does not exist") ErrGraphAlreadyExist = errors.New("graph has already existed") )
Functions ¶
func GenGenericOssResourcePrefixKey ¶
GenGenericOssResourcePrefixKey generates generic oss resource prefix, which is use for OssStorage and S3Storage.
func GenGraphDirPath ¶
GenResourceDirPath generates the resource dir path, which is used for LocalStorage.
func GenResourcePrefixKeyWithPath ¶
GenResourcePrefixKeyWithPath 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 resource.Storage which uses local filesystem as storage.
func NewLocalStorage ¶
func NewLocalStorage(path string) (*LocalStorage, error)
NewLocalStorage news local resource storage, and derives graph. For instance, local path is ~/.kusion/resources/project/workspace
func (*LocalStorage) CheckGraphStorageExistence ¶
func (s *LocalStorage) CheckGraphStorageExistence() bool
CheckGraphStorageExistence checks whether the graph storage exists.
func (*LocalStorage) Create ¶
func (s *LocalStorage) Create(r *v1.Graph) error
Create creates the graph in s3.
type OssStorage ¶
type OssStorage struct {
// contains filtered or unexported fields
}
OssStorage is an implementation of graph.Storage which uses oss as storage.
func NewOssStorage ¶
func NewOssStorage(bucket *oss.Bucket, prefix string) (*OssStorage, error)
NewOssStorage news oss graph storage, and derives metadata.
func (*OssStorage) CheckGraphStorageExistence ¶
func (s *OssStorage) CheckGraphStorageExistence() bool
CheckGraphStorageExistence checks whether the graph storage exists.
type S3Storage ¶
type S3Storage struct {
// contains filtered or unexported fields
}
S3Storage is an implementation of graph.Storage which uses s3 as storage.
func NewS3Storage ¶
NewS3Storage news s3 graph storage, and derives metadata.
func (*S3Storage) CheckGraphStorageExistence ¶
CheckGraphStorageExistence checks whether the graph storage exists.