events

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceOrder_CreateOrderSuccess = "resource.create_order.cmd"
View Source
const ResourceOrder_ReNewOrderSuccess = "resource.renew_order.cmd"
View Source
const ResourceOrder_WithdrawLockedOrderPriceSuccess = "resource.cancel_order.cmd"

Variables

View Source
var GlobalEventBus = newEventBus()

Functions

This section is empty.

Types

type CancelVM

type CancelVM struct {
	OrderIndex uint64
	// contains filtered or unexported fields
}

func (*CancelVM) AddCompleteCallback

func (e *CancelVM) AddCompleteCallback(callback func())

func (*CancelVM) Hook

func (e *CancelVM) Hook() error

Hook event triggered execution

func (*CancelVM) SetVmManager

func (e *CancelVM) SetVmManager(manager vm.Manager)

type Event

type Event struct {
	Tag  OperationTag
	Data string
}

type EventHandleFunc

type EventHandleFunc func(e string, args interface{})

type EventHandler

type EventHandler struct {
	ID      string
	Handler EventHandleFunc
}

type EventInterface

type EventInterface interface {

	// Hook event triggered execution
	Hook() error
	// SetVmManager set up vm management
	SetVmManager(manager vm.Manager)

	// AddCompleteCallback  add event completion callback
	AddCompleteCallback(func())
}

type EventWriter

type EventWriter struct {
}

type IEventBus

type IEventBus interface {
	Pub(e string, args interface{})
	Sub(e string, id string, handleFunc EventHandleFunc)
	Unsub(e string, id string)
}

type OperationTag

type OperationTag int
const OPCreated OperationTag = 1
const OPDeleted OperationTag = 3
const OPUpdated OperationTag = 2

type RenewVM

type RenewVM struct {
	OrderIndex uint64
	// contains filtered or unexported fields
}

func (*RenewVM) AddCompleteCallback

func (e *RenewVM) AddCompleteCallback(callback func())

func (*RenewVM) Hook

func (e *RenewVM) Hook() error

Hook event triggered execution

func (*RenewVM) SetVmManager

func (e *RenewVM) SetVmManager(manager vm.Manager)

type StartVm

type StartVm struct {
	Cpu       uint64
	Memory    uint64
	Disk      uint64
	Name      string
	System    string
	PublicKey string
	Image     string
	// contains filtered or unexported fields
}

func (*StartVm) AddCompleteCallback

func (e *StartVm) AddCompleteCallback(callback func())

func (*StartVm) Hook

func (e *StartVm) Hook() error

func (*StartVm) SetVmManager

func (e *StartVm) SetVmManager(manager vm.Manager)

Jump to

Keyboard shortcuts

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