Documentation ¶
Index ¶
- Constants
- Variables
- type AbstractHandler
- type CreateVmHandler
- type DestroyVmHandler
- type EventBus
- type EventContext
- type EventHandleFunc
- type EventHandler
- type EventService
- type IEventBus
- type IEventService
- type IHandler
- type IVmEventHandler
- type OperationTag
- type RecoverVmHandler
- type RenewVmHandler
- type TheGraphHandler
- type VmRequest
Constants ¶
View Source
const ResourceOrder_CreateOrderSuccess = "resource.create_order.cmd"
View Source
const ResourceOrder_ReNewOrderSuccess = "resource.renew_order.cmd"
View Source
const ResourceOrder_Recover = "resource.recover_order.cmd"
View Source
const ResourceOrder_TheGraph = "resource.thegraph"
View Source
const ResourceOrder_WithdrawLockedOrderPriceSuccess = "resource.cancel_order.cmd"
Variables ¶
View Source
var GlobalEventBus = newEventBus()
Functions ¶
This section is empty.
Types ¶
type AbstractHandler ¶
type AbstractHandler struct { }
func (*AbstractHandler) EventHandleFunc ¶
func (h *AbstractHandler) EventHandleFunc(handler IHandler) EventHandleFunc
type CreateVmHandler ¶
type CreateVmHandler struct { AbstractHandler CoreContext *EventContext }
func (*CreateVmHandler) HandlerEvent ¶
func (h *CreateVmHandler) HandlerEvent(e *VmRequest)
func (*CreateVmHandler) Name ¶
func (h *CreateVmHandler) Name() string
type DestroyVmHandler ¶
type DestroyVmHandler struct { AbstractHandler CoreContext *EventContext }
func (*DestroyVmHandler) HandlerEvent ¶
func (h *DestroyVmHandler) HandlerEvent(e *VmRequest)
func (*DestroyVmHandler) Name ¶
func (h *DestroyVmHandler) Name() string
type EventContext ¶
type EventContext struct { ReportClient chain.ReportClient VmManager provider.Manager TimerService *utils.TimerService Cm *config.ConfigManager P2pClient *p2p.P2pClient }
func (*EventContext) GetConfig ¶
func (ec *EventContext) GetConfig() *config.Config
type EventHandleFunc ¶
type EventHandleFunc func(e string, args interface{})
type EventHandler ¶
type EventHandler struct { ID string Handler EventHandleFunc }
type EventService ¶
type EventService struct {
// contains filtered or unexported fields
}
func (*EventService) Create ¶
func (s *EventService) Create(req *VmRequest)
func (*EventService) Destroy ¶
func (s *EventService) Destroy(req *VmRequest)
func (*EventService) Recover ¶
func (s *EventService) Recover(req *VmRequest)
func (*EventService) Renew ¶
func (s *EventService) Renew(req *VmRequest)
type IEventService ¶
type IEventService interface { Create(r *VmRequest) Destroy(r *VmRequest) Renew(r *VmRequest) Recover(r *VmRequest) }
func NewEventService ¶
func NewEventService(coreContext *EventContext) IEventService
type IVmEventHandler ¶
type IVmEventHandler interface {
EventHandleFunc(e string, args interface{})
}
type OperationTag ¶
type OperationTag int
const OPCreatedVm OperationTag = 1
const OPDestroyVm OperationTag = 2
const OPFreeResourceApply OperationTag = 5
const OPRecoverVM OperationTag = 4
const OPRenewVM OperationTag = 3
type RecoverVmHandler ¶
type RecoverVmHandler struct { AbstractHandler CoreContext *EventContext }
func (*RecoverVmHandler) HandlerEvent ¶
func (h *RecoverVmHandler) HandlerEvent(e *VmRequest)
func (*RecoverVmHandler) Name ¶
func (h *RecoverVmHandler) Name() string
type RenewVmHandler ¶
type RenewVmHandler struct { AbstractHandler CoreContext *EventContext }
func (*RenewVmHandler) HandlerEvent ¶
func (h *RenewVmHandler) HandlerEvent(e *VmRequest)
func (*RenewVmHandler) Name ¶
func (h *RenewVmHandler) Name() string
type TheGraphHandler ¶ added in v1.2.0
type TheGraphHandler struct { AbstractHandler CoreContext *EventContext }
func (*TheGraphHandler) HandlerEvent ¶ added in v1.2.0
func (h *TheGraphHandler) HandlerEvent(e *VmRequest)
func (*TheGraphHandler) Name ¶ added in v1.2.0
func (h *TheGraphHandler) Name() string
Click to show internal directories.
Click to hide internal directories.