Documentation ¶
Index ¶
- Variables
- func CompleteLocalConfig(config *v1.BackendLocalConfig) error
- func CompleteMysqlConfig(config *v1.BackendMysqlConfig)
- func CompleteOssConfig(config *v1.BackendOssConfig)
- func CompleteS3Config(config *v1.BackendS3Config)
- func ValidateMysqlConfig(config *v1.BackendMysqlConfig) error
- func ValidateMysqlConfigFromFile(config *v1.BackendMysqlConfig) error
- func ValidateOssConfig(config *v1.BackendOssConfig) error
- func ValidateOssConfigFromFile(config *v1.BackendOssConfig) error
- func ValidateS3Config(config *v1.BackendS3Config) error
- func ValidateS3ConfigFromFile(config *v1.BackendS3Config) error
- type LocalStorage
- type MysqlStorage
- type OssStorage
- type S3Storage
Constants ¶
This section is empty.
Variables ¶
var ( ErrEmptyMysqlDBName = errors.New("empty db name") ErrEmptyMysqlUser = errors.New("empty mysql db user") ErrEmptyMysqlHost = errors.New("empty mysql host") ErrInvalidMysqlPort = errors.New("mysql port must be between 1 and 65535") 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 CompleteMysqlConfig ¶
func CompleteMysqlConfig(config *v1.BackendMysqlConfig)
CompleteMysqlConfig sets default value of port if not set, which is 3306, and fulfills password from environment variables if set.
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 ValidateMysqlConfig ¶
func ValidateMysqlConfig(config *v1.BackendMysqlConfig) error
ValidateMysqlConfig is used to validate the v1.BackendMysqlConfig is valid or not. If valid, the config contains all valid items to new a mysql DB.
func ValidateMysqlConfigFromFile ¶
func ValidateMysqlConfigFromFile(config *v1.BackendMysqlConfig) error
ValidateMysqlConfigFromFile is used to validate the v1.BackendMysqlConfig parsed from config file is valid or not, where the sensitive data items set as environment variables are not included.
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) StateStorage ¶
func (s *LocalStorage) StateStorage(project, workspace string) state.Storage
func (*LocalStorage) WorkspaceStorage ¶
func (s *LocalStorage) WorkspaceStorage() (workspace.Storage, error)
type MysqlStorage ¶
type MysqlStorage struct {
// contains filtered or unexported fields
}
MysqlStorage is an implementation of backend.Backend which uses mysql as storage.
func NewMysqlStorage ¶
func NewMysqlStorage(config *v1.BackendMysqlConfig) (*MysqlStorage, error)
func (*MysqlStorage) StateStorage ¶
func (s *MysqlStorage) StateStorage(project, workspace string) state.Storage
func (*MysqlStorage) WorkspaceStorage ¶
func (s *MysqlStorage) 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) StateStorage ¶
func (s *OssStorage) StateStorage(project, workspace string) state.Storage
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)