statehub

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultVolumeSize represents the default volume size.
	DefaultVolumeSize int64 = 1 * util.GiB
)

Defaults

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskOptions

type DiskOptions struct {
	CapacityBytes int64
	VolumeType    string
}

DiskOptions represents parameters to create a state's volume

type Metadata

type Metadata struct {
	InstanceID       string
	Region           string
	AvailabilityZone string
	Vnet             string
	Subnet           string
	CloudProvider    string
	ProviderScope    string
}

func (*Metadata) GetAvailabilityZone

func (m *Metadata) GetAvailabilityZone() string

GetAvailabilityZone returns the Availability Zone which the instance is in.

func (*Metadata) GetCloudProvider

func (m *Metadata) GetCloudProvider() string

GetCloudProvider returns node's provider

func (*Metadata) GetInstanceID

func (m *Metadata) GetInstanceID() string

GetInstanceID returns the instance identification.

func (*Metadata) GetProviderScope

func (m *Metadata) GetProviderScope() string

GetProviderScope returns an aws account id or azure subscription id

func (*Metadata) GetRegion

func (m *Metadata) GetRegion() string

GetLocation returns the region which the instance is in.

func (*Metadata) GetSubnet

func (m *Metadata) GetSubnet() string

GetSubnet returns node's subnet

func (*Metadata) GetVnet

func (m *Metadata) GetVnet() string

GetVnet returns node's vnet

type MetadataService

type MetadataService interface {
	GetInstanceID() string
	GetRegion() string
	GetAvailabilityZone() string
	GetVnet() string
	GetSubnet() string
	GetCloudProvider() string
	GetProviderScope() string
}

MetadataService represents multi-cloud metadata service.

func NewMetadata

func NewMetadata() (MetadataService, error)

func NewMetadataService

func NewMetadataService(clientset kubernetes.Interface) (MetadataService, error)

NewMetadataService returns a new MetadataServiceImplementation.

type StateHub

type StateHub interface {
	CreateVolume(ctx context.Context, volumeOptions *statehubAPI.CreateVolumeDto, state string) (*statehubAPI.Volume, error)
	DeleteDisk(ctx context.Context, volumeName string) (success bool, err error)
	ResizeDisk(ctx context.Context, volumeName string, reqSize int32) (newSize int32, err error)
	GetVolumeByName(ctx context.Context, state string, volumeName string) (*statehubAPI.Volume, error)
}

func NewStatehub

func NewStatehub(statehubapi string) (StateHub, error)

Jump to

Keyboard shortcuts

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