Documentation
¶
Index ¶
- Constants
- func IsApiCallError(err error) bool
- func IsInternalError(err error) bool
- func IsNotFoundError(err error) bool
- func IsParameterError(err error) bool
- func IsResourceError(err error) bool
- type ErrorReasonType
- type Resource
- type ResourceError
- type ResourceErrorImplErrorImpl
- type ResourceErrorType
- type ResourceManager
- func (rm *ResourceManager) CreateResource(meta *ResourceMeta) (*ResourceMeta, error)
- func (rm *ResourceManager) DeleteResource(meta *ResourceMeta) error
- func (rm *ResourceManager) GetResource(meta *ResourceMeta) (Resource, error)
- func (rm *ResourceManager) GetResourceEndpoint(meta *ResourceMeta) (string, error)
- func (rm *ResourceManager) ListResources(namespaces []string, resourcesLabels map[string]string) ([]Resource, error)
- func (rm *ResourceManager) PauseResource(meta *ResourceMeta) error
- func (rm *ResourceManager) RecoverResource(meta *ResourceMeta) (Resource, error)
- func (rm *ResourceManager) RestartResource(meta *ResourceMeta) error
- type ResourceMeta
Constants ¶
View Source
const ( PauseReason = "Instance paused" NotExistReason = "Instance not existed" ResourceMetaNullReason = "ResourceMeta is Null" IdNullReason = "ID is Null" IdNotIntegerReason = "ID is not Integer" NameNullReason = "Name is Null" NamespaceNullReason = "Namespace is Null" )
Variables ¶
This section is empty.
Functions ¶
func IsApiCallError ¶
func IsInternalError ¶
func IsNotFoundError ¶
func IsParameterError ¶
func IsResourceError ¶
Types ¶
type ErrorReasonType ¶
type ErrorReasonType string
func GetErrorReason ¶
func GetErrorReason(err error) ErrorReasonType
type ResourceError ¶
type ResourceError interface { Error() string Reason() ErrorReasonType Type() ResourceErrorType }
func NewResourceError ¶
func NewResourceError(errorType ResourceErrorType, errorReason ErrorReasonType, msg string, args ...interface{}) ResourceError
type ResourceErrorImplErrorImpl ¶
type ResourceErrorImplErrorImpl struct {
// contains filtered or unexported fields
}
func (ResourceErrorImplErrorImpl) Error ¶
func (r ResourceErrorImplErrorImpl) Error() string
func (ResourceErrorImplErrorImpl) Reason ¶
func (r ResourceErrorImplErrorImpl) Reason() ErrorReasonType
func (ResourceErrorImplErrorImpl) Type ¶
func (r ResourceErrorImplErrorImpl) Type() ResourceErrorType
type ResourceErrorType ¶
type ResourceErrorType string
const ( ApiCallError ResourceErrorType = "ApiCallError" InternalError ResourceErrorType = "InternalError" ParameterError ResourceErrorType = "ParameterError" NotFoundError ResourceErrorType = "NotFoundError" )
func GetErrorType ¶
func GetErrorType(err error) ResourceErrorType
type ResourceManager ¶
ResourceManager conteroller
func NewResourceManager ¶
func NewResourceManager() *ResourceManager
func (*ResourceManager) CreateResource ¶
func (rm *ResourceManager) CreateResource(meta *ResourceMeta) (*ResourceMeta, error)
func (*ResourceManager) DeleteResource ¶
func (rm *ResourceManager) DeleteResource(meta *ResourceMeta) error
func (*ResourceManager) GetResource ¶
func (rm *ResourceManager) GetResource(meta *ResourceMeta) (Resource, error)
func (*ResourceManager) GetResourceEndpoint ¶
func (rm *ResourceManager) GetResourceEndpoint(meta *ResourceMeta) (string, error)
func (*ResourceManager) ListResources ¶
func (*ResourceManager) PauseResource ¶
func (rm *ResourceManager) PauseResource(meta *ResourceMeta) error
func (*ResourceManager) RecoverResource ¶
func (rm *ResourceManager) RecoverResource(meta *ResourceMeta) (Resource, error)
func (*ResourceManager) RestartResource ¶
func (rm *ResourceManager) RestartResource(meta *ResourceMeta) error
Click to show internal directories.
Click to hide internal directories.