Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateActionId() uint64
- func RangeFiles(f func(file *files.File, relativePath string))
- func RegisterActionType(actions ...ActionInterface)
- type Action
- type ActionInterface
- type FailAction
- type Manager
- func (this *Manager) BuildSum()
- func (this *Manager) Error() string
- func (this *Manager) IsActive() bool
- func (this *Manager) IsChanged() bool
- func (this *Manager) PullItems()
- func (this *Manager) PushItems()
- func (this *Manager) Read(f func(action ActionInterface))
- func (this *Manager) Restart()
- func (this *Manager) SetIsChanged(isChanged bool)
- func (this *Manager) Start() error
- func (this *Manager) Stop() error
- func (this *Manager) Write(action ActionInterface) error
- type NotifyAction
- type PingAction
- type PullAction
- type PushAction
- type RegisterAction
- type SuccessAction
- type SumAction
- type SyncAction
Constants ¶
View Source
const (
ClusterEnabled = true
)
Variables ¶
Functions ¶
func GenerateActionId ¶
func GenerateActionId() uint64
func RangeFiles ¶
func RegisterActionType ¶
func RegisterActionType(actions ...ActionInterface)
Types ¶
type Action ¶
func (*Action) BaseAction ¶
func (*Action) OnFail ¶
func (this *Action) OnFail(fail *FailAction) error
func (*Action) OnSuccess ¶
func (this *Action) OnSuccess(success *SuccessAction) error
type ActionInterface ¶
type ActionInterface interface { Name() string Execute() error OnSuccess(success *SuccessAction) error OnFail(fail *FailAction) error TypeId() int8 BaseAction() *Action }
func FindActionInstance ¶
func FindActionInstance(typeId int8) ActionInterface
type FailAction ¶
func (*FailAction) Name ¶
func (this *FailAction) Name() string
func (*FailAction) TypeId ¶
func (this *FailAction) TypeId() int8
type Manager ¶
type Manager struct { RestartChan chan bool // contains filtered or unexported fields }
cluster communication manager
func NewManager ¶
func NewManager() *Manager
func (*Manager) Read ¶
func (this *Manager) Read(f func(action ActionInterface))
read action from cluster
func (*Manager) SetIsChanged ¶
func (*Manager) Write ¶
func (this *Manager) Write(action ActionInterface) error
write action message to cluster manager
type NotifyAction ¶
type NotifyAction struct {
Action
}
cluster -> slave node
func (*NotifyAction) Execute ¶
func (this *NotifyAction) Execute() error
func (*NotifyAction) Name ¶
func (this *NotifyAction) Name() string
func (*NotifyAction) TypeId ¶
func (this *NotifyAction) TypeId() int8
type PingAction ¶
node -> cluster
func (*PingAction) Name ¶
func (this *PingAction) Name() string
func (*PingAction) TypeId ¶
func (this *PingAction) TypeId() int8
type PullAction ¶
node <- cluster
func (*PullAction) Execute ¶
func (this *PullAction) Execute() error
func (*PullAction) Name ¶
func (this *PullAction) Name() string
func (*PullAction) TypeId ¶
func (this *PullAction) TypeId() int8
type PushAction ¶
master -> cluster
func (*PushAction) AddItem ¶
func (this *PushAction) AddItem(item *configs.Item)
func (*PushAction) Execute ¶
func (this *PushAction) Execute() error
func (*PushAction) Name ¶
func (this *PushAction) Name() string
func (*PushAction) OnFail ¶
func (this *PushAction) OnFail(fail *FailAction) error
func (*PushAction) OnSuccess ¶
func (this *PushAction) OnSuccess(success *SuccessAction) error
func (*PushAction) TypeId ¶
func (this *PushAction) TypeId() int8
type RegisterAction ¶
type RegisterAction struct { Action ClusterId string ClusterSecret string NodeId string NodeName string NodeRole string }
func (*RegisterAction) Execute ¶
func (this *RegisterAction) Execute() error
func (*RegisterAction) Name ¶
func (this *RegisterAction) Name() string
func (*RegisterAction) OnFail ¶
func (this *RegisterAction) OnFail(fail *FailAction) error
func (*RegisterAction) OnSuccess ¶
func (this *RegisterAction) OnSuccess(success *SuccessAction) error
func (*RegisterAction) TypeId ¶
func (this *RegisterAction) TypeId() int8
type SuccessAction ¶
func (*SuccessAction) Name ¶
func (this *SuccessAction) Name() string
func (*SuccessAction) TypeId ¶
func (this *SuccessAction) TypeId() int8
type SumAction ¶
type SumAction struct {
Action
}
cluster -> master|node
func (*SumAction) OnFail ¶
func (this *SumAction) OnFail(fail *FailAction) error
func (*SumAction) OnSuccess ¶
func (this *SumAction) OnSuccess(success *SuccessAction) error
type SyncAction ¶
type SyncAction struct { Action ItemActions []*configs.ItemAction }
cluster -> node
func (*SyncAction) Execute ¶
func (this *SyncAction) Execute() error
func (*SyncAction) Name ¶
func (this *SyncAction) Name() string
func (*SyncAction) TypeId ¶
func (this *SyncAction) TypeId() int8
Source Files ¶
Click to show internal directories.
Click to hide internal directories.