manager

package
v0.0.0-...-fef4acc Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default StateType = ""

	NoOp EventType = "NoOp"
)

Variables

View Source
var (
	CreateCompleted                EventType = EventType(api.ResourceStatus_CREATE_COMPLETED.String())
	CreateFailed                   EventType = EventType(api.ResourceStatus_CREATE_FAILED.String())
	CreateInProgressLogicalVolume  EventType = EventType("CreateInProgressLogicalVolume")
	CreateInProgressPhysicalVolume EventType = EventType("CreateInProgressPhysicalVolume")
	CreateInProgressVolumeGroup    EventType = EventType("CreateInProgressVolumeGroup")
	ReviewCompleted                EventType = EventType(api.ResourceStatus_REVIEW_COMPLETED.String())
	ReviewFailed                   EventType = EventType(api.ResourceStatus_REVIEW_FAILED.String())
	ReviewInProgressLogicalVolume  EventType = EventType("ReviewInProgressLogicalVolume")
	ReviewInProgressPhysicalVolume EventType = EventType("ReviewInProgressPhysicalVolume")
	ReviewInProgressVolumeGroup    EventType = EventType("ReviewInProgressVolumeGroup")

	CreateComplete       StateType = StateType("CreateComplete")
	CreateFail           StateType = StateType("CreateFail")
	CreateLogicalVolume  StateType = StateType("CreateLogicalVolume")
	CreatePhysicalVolume StateType = StateType("CreatePhysicalVolume")
	CreateVolumeGroup    StateType = StateType("CreateVolumeGroup")
	ReviewComplete       StateType = StateType("ReviewComplete")
	ReviewFail           StateType = StateType("ReviewFail")
	ReviewLogicalVolume  StateType = StateType("ReviewLogicalVolume")
	ReviewPhysicalVolume StateType = StateType("ReviewPhysicalVolume")
	ReviewVolumeGroup    StateType = StateType("ReviewVolumeGroup")
)

Functions

This section is empty.

Types

type Action

type Action interface {
	Execute(eventCtx EventContent) EventType
}

type CreateLogicalVolumeAction

type CreateLogicalVolumeAction struct{}

func (*CreateLogicalVolumeAction) Execute

func (a *CreateLogicalVolumeAction) Execute(eventCtx EventContent) EventType

type CreatePhysicalVolumeAction

type CreatePhysicalVolumeAction struct{}

func (*CreatePhysicalVolumeAction) Execute

func (a *CreatePhysicalVolumeAction) Execute(eventCtx EventContent) EventType

type CreateVolumeGroupAction

type CreateVolumeGroupAction struct{}

func (*CreateVolumeGroupAction) Execute

func (a *CreateVolumeGroupAction) Execute(eventCtx EventContent) EventType

type DiskImageStore

type DiskImageStore struct {
	Path string
}

DiskImageStore : used for storing images to disk

func NewDiskImageStore

func NewDiskImageStore(path string) (*DiskImageStore, error)

NewDiskImageStore : creates a new disk image store

func (*DiskImageStore) Save

func (s *DiskImageStore) Save(options ImageStoreSaveOptions) error

Save : save handler for disk image store

type EventContent

type EventContent interface{}

type EventType

type EventType string

type Events

type Events map[EventType]StateType

type ImageStore

type ImageStore interface {
	Save(options ImageStoreSaveOptions) (*api.Image, error)
}

ImageStore : base image store implementation

type ImageStoreSaveOptions

type ImageStoreSaveOptions struct {
	Data        bytes.Buffer
	Description string
	File        string
	Name        string
	Size        int64
}

ImageStoreSaveOptions : generic configuration for store save handler

type Manager

type Manager struct {
	ErrorC chan error
	State  *StateMachine
	// contains filtered or unexported fields
}

Manager : defines manager service

func New

func New() (*Manager, error)

New : creates a new apiserver instance

func (*Manager) Start

func (m *Manager) Start()

Start : handles start of apiserver service

type ReviewLogicalVolumeAction

type ReviewLogicalVolumeAction struct{}

func (*ReviewLogicalVolumeAction) Execute

func (a *ReviewLogicalVolumeAction) Execute(eventCtx EventContent) EventType

type ReviewPhysicalVolumeAction

type ReviewPhysicalVolumeAction struct{}

func (*ReviewPhysicalVolumeAction) Execute

func (a *ReviewPhysicalVolumeAction) Execute(eventCtx EventContent) EventType

type ReviewVolumeGroupAction

type ReviewVolumeGroupAction struct{}

func (*ReviewVolumeGroupAction) Execute

func (a *ReviewVolumeGroupAction) Execute(eventCtx EventContent) EventType

type State

type State struct {
	Action Action
	Events Events
}

type StateCreateFailAction

type StateCreateFailAction struct{}

func (*StateCreateFailAction) Execute

func (a *StateCreateFailAction) Execute(eventCtx EventContent) EventType

type StateEventContext

type StateEventContext struct {
	Manager      *Manager
	ResourceID   uuid.UUID
	ResourceType api.ResourceType
}

type StateMachine

type StateMachine struct {
	Current  StateType
	Previous StateType
	States   States
	// contains filtered or unexported fields
}

func (*StateMachine) SendEvent

func (s *StateMachine) SendEvent(event EventType, eventCtx EventContent)

type StateReviewCompleteAction

type StateReviewCompleteAction struct{}

func (*StateReviewCompleteAction) Execute

func (a *StateReviewCompleteAction) Execute(eventCtx EventContent) EventType

type StateReviewFailAction

type StateReviewFailAction struct{}

func (*StateReviewFailAction) Execute

func (a *StateReviewFailAction) Execute(eventCtx EventContent) EventType

type StateType

type StateType string

type States

type States map[StateType]State

Jump to

Keyboard shortcuts

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