resources

package
v0.0.0-...-836d277 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

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 IsApiCallError(err error) bool

func IsInternalError

func IsInternalError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func IsParameterError

func IsParameterError(err error) bool

func IsResourceError

func IsResourceError(err error) bool

Types

type ErrorReasonType

type ErrorReasonType string

func GetErrorReason

func GetErrorReason(err error) ErrorReasonType

type Resource

type Resource interface {
	v1.Object
}

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 (ResourceErrorImplErrorImpl) Reason

func (ResourceErrorImplErrorImpl) Type

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

type ResourceManager struct {
	client.Client
}

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 (rm *ResourceManager) ListResources(namespaces []string, resourcesLabels map[string]string) ([]Resource, error)

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

type ResourceMeta

type ResourceMeta struct {
	Name      string
	Namespace string
	ID        string
	Type      string
}

Jump to

Keyboard shortcuts

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