types

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package types defines the contracts that are used to provision a supported edge cluster and managing them

Package types defines the contracts that are used to provision a supported edge cluster and managing them

Package types defines the contracts that are used to provision a supported edge cluster and managing them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsEdgeClusterNotSupportedError

func IsEdgeClusterNotSupportedError(err error) bool

IsEdgeClusterNotSupportedError indicates whether the error is of type EdgeClusterNotSupportedError

func IsUnknownError

func IsUnknownError(err error) bool

IsUnknownError indicates whether the error is of type UnknownError

func NewEdgeClusterNotSupportedError

func NewEdgeClusterNotSupportedError(edgeClusterType EdgeClusterType) error

NewEdgeClusterNotSupportedError creates a new EdgeClusterNotSupportedError error edgeClusterType: Mandatory. The type of the edge cluster that is not suppoorted

func NewEdgeClusterNotSupportedErrorWithError

func NewEdgeClusterNotSupportedErrorWithError(
	edgeClusterType EdgeClusterType,
	err error) error

NewEdgeClusterNotSupportedErrorWithError creates a new EdgeClusterNotSupportedError error edgeClusterType: Mandatory. The type of the edge cluster that is not suppoorted

func NewUnknownError

func NewUnknownError(message string) error

NewUnknownError creates a new UnknownError error

func NewUnknownErrorWithError

func NewUnknownErrorWithError(message string, err error) error

NewUnknownErrorWithError creates a new UnknownError error

Types

type DeleteProvisionRequest added in v0.0.18

type DeleteProvisionRequest struct {
	EdgeClusterID string
}

DeleteProvisionRequest contains the request to delete an existing provision

type DeleteProvisionResponse added in v0.0.18

type DeleteProvisionResponse struct {
}

DeleteProvisionResponse contains the result of deleting an existing edge cluster provision

type EdgeClusterFactoryContract

type EdgeClusterFactoryContract interface {
	// Create instantiates a new edge cluster provisioner of a requested edge cluster type and returns
	// it to the caller.
	// ctx: Mandatory The reference to the context
	// edgeClusterType: Mandatory. The type of edge cluster provisioner to be instantiated
	// Returns either the result of instantiating a edge cluster provisioner or error if something goes wrong.
	Create(
		ctx context.Context,
		edgeClusterType EdgeClusterType) (EdgeClusterProvisionerContract, error)
}

EdgeClusterFactoryContract defines the factory method that are used to create provisioner for different supported type of edge cluster (e.g. K3S)

type EdgeClusterNotSupportedError

type EdgeClusterNotSupportedError struct {
	Err             error
	EdgeClusterType EdgeClusterType
}

EdgeClusterNotSupportedError indicates that the requested edge cluster is not suipported

func (EdgeClusterNotSupportedError) Error

Error returns message for the EdgeClusterNotSupportedError error type Returns the error nessage

func (EdgeClusterNotSupportedError) Unwrap

Unwrap returns the err if provided through NewEdgeClusterNotSupportedErrorWithError function, otherwise returns nil

type EdgeClusterProvisionerContract

type EdgeClusterProvisionerContract interface {
	// NewProvision provisions a new edge cluster.
	// ctx: Mandatory The reference to the context
	// request: Mandatory. The request to provision a new edge cluster
	// Returns either the result of provisioning new edge cluster or error if something goes wrong.
	NewProvision(
		ctx context.Context,
		request *NewProvisionRequest) (*NewProvisionResponse, error)

	// UpdateProvisionWithRetry updates an existing edge cluster.
	// ctx: Mandatory The reference to the context
	// request: Mandatory. The request to update an existing edge cluster.
	// Returns either the result of updating an existing edge cluster or error if something goes wrong.
	UpdateProvisionWithRetry(
		ctx context.Context,
		request *UpdateProvisionRequest) (response *UpdateProvisionResponse, err error)

	// DeleteProvision deletes an edge cluster.
	// ctx: Mandatory The reference to the context
	// request: Mandatory. The request to delete an edge cluster
	// Returns either the result of deleting an edge cluster or error if something goes wrong.
	DeleteProvision(
		ctx context.Context,
		request *DeleteProvisionRequest) (response *DeleteProvisionResponse, err error)
}

EdgeClusterProvisionerContract defines the methods that are required to provision a supported type of edge cluster

type EdgeClusterType

type EdgeClusterType int
const (
	K3S EdgeClusterType = iota
)

type NewProvisionRequest

type NewProvisionRequest struct {
	EdgeClusterID string
	ClusterSecret string
}

NewProvisionRequest contains the request to provision a new supported edge cluser

type NewProvisionResponse

type NewProvisionResponse struct {
}

NewProvisionResponse contains the result of provisioning a new supported edge cliuster

type UnknownError

type UnknownError struct {
	Message string
	Err     error
}

UnknownError indicates that an unknown error has happened<Paste>

func (UnknownError) Error

func (e UnknownError) Error() string

Error returns message for the UnknownError error type Returns the error nessage

func (UnknownError) Unwrap

func (e UnknownError) Unwrap() error

Unwrap returns the err if provided through NewUnknownErrorWithError function, otherwise returns nil

type UpdateProvisionRequest added in v0.0.18

type UpdateProvisionRequest struct {
	EdgeClusterID string
	ClusterSecret string
}

UpdateProvisionRequest contains the request to update an existing supported edge cluser

type UpdateProvisionResponse added in v0.0.18

type UpdateProvisionResponse struct {
}

UpdateProvisionResponse contains the result of updating an existing supported edge cliuster

Directories

Path Synopsis
Package mock_types is a generated GoMock package.
Package mock_types is a generated GoMock package.

Jump to

Keyboard shortcuts

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