Documentation ¶
Index ¶
- Variables
- func DelayedNode(node interface{}, time time.Duration) interface{}
- type CMD
- func (c CMD) Execute(ctx context.Context) error
- func (c CMD) GetData() Node
- func (c CMD) Init()
- func (c CMD) MarshalBinary() ([]byte, error)
- func (c CMD) OnFailed(e error) error
- func (c CMD) OnFinalFailed(e error) error
- func (c CMD) OnSuccess() error
- func (c CMD) SetData(n Node) NodeRetry
- func (c CMD) TimeToSleepOnNextFailed(retry int) time.Duration
- func (c *CMD) UnmarshalBinary(data []byte) error
- type CMDFailed
- type CMDFinalFailed
- type CMDSuccess
- type HTTP
- func (h HTTP) Execute(ctx context.Context) error
- func (h HTTP) GetData() Node
- func (h HTTP) Init()
- func (h HTTP) MarshalBinary() ([]byte, error)
- func (h HTTP) OnFailed(e error) error
- func (h HTTP) OnFinalFailed(e error) error
- func (h HTTP) OnSuccess() error
- func (h HTTP) SetData(n Node) NodeRetry
- func (h HTTP) TimeToSleepOnNextFailed(retry int) time.Duration
- func (h *HTTP) UnmarshalBinary(data []byte) error
- type HTTPFailed
- type HTTPFinalFailed
- type HTTPSuccess
- type Node
- func (n Node) Execute(ctx context.Context) error
- func (n *Node) GetAttempt() int
- func (n Node) GetData() Node
- func (n Node) Init()
- func (n Node) MarshalBinary() ([]byte, error)
- func (n *Node) NodeGobDecode(dec *gob.Decoder) error
- func (n *Node) NodeGobEncode(enc *gob.Encoder) error
- func (n Node) OnFailed(e error) error
- func (n Node) OnFinalFailed(e error) error
- func (n Node) OnSuccess() error
- func (n Node) SetData(value Node) NodeRetry
- func (n Node) String() string
- func (n Node) TimeToSleepOnNextFailed(retry int) time.Duration
- func (n *Node) UnmarshalBinary(data []byte) error
- type NodeRemove
- type NodeRetry
- type Queue
- func (rq *Queue) EnqueueExecAndRetry(n interface{})
- func (rq *Queue) Init(store RStore)
- func (rq *Queue) Persist(uuid string, data interface{}) error
- func (rq *Queue) Register(i interface{}, success func(interface{}) error, ...)
- func (rq *Queue) RemoveByName(name string)
- func (rq *Queue) Start()
- func (rq *Queue) Stop()
- type RStore
Constants ¶
This section is empty.
Variables ¶
var ( //ErrRetryNotImplemented return error when default behaviour ErrRetryNotImplemented = errors.New("The method is not implemented") )
var (
//MAXRETRYINFINITE generate infinite retry (cron)
MAXRETRYINFINITE = -1
)
Functions ¶
func DelayedNode ¶
DelayedNode Create a Delayed node container
Types ¶
type CMD ¶
CMD Struct
func (CMD) MarshalBinary ¶
MarshalBinary implement retry interface
func (CMD) OnFinalFailed ¶
OnFinalFailed implement retry interface
func (CMD) TimeToSleepOnNextFailed ¶
TimeToSleepOnNextFailed implement retry interface
func (*CMD) UnmarshalBinary ¶
UnmarshalBinary implement retry interface
type HTTP ¶
type HTTP struct { Node URL string Method string HTTPPostData map[string][]string HTTPGetData map[string][]string HTTPHeader map[string]string WaitingTime int SuccessFunc HTTPSuccess FailedFunc HTTPFailed FinalFailedFunc HTTPFinalFailed }
HTTP Struct
func (HTTP) MarshalBinary ¶
MarshalBinary implement retryit interface
func (HTTP) OnFinalFailed ¶
OnFinalFailed implement retryit interface
func (HTTP) TimeToSleepOnNextFailed ¶
TimeToSleepOnNextFailed implement retryit interface
func (*HTTP) UnmarshalBinary ¶
UnmarshalBinary implement retryit interface
type HTTPFinalFailed ¶
HTTPFinalFailed HTTPFinalFailed method
type Node ¶
type Node struct { //public Description string MaxRetry int NoPersist bool Name string // contains filtered or unexported fields }
Node Node struct
func (Node) MarshalBinary ¶
MarshalBinary implement marshal
func (*Node) NodeGobDecode ¶
NodeGobDecode Decode for deserialised
func (*Node) NodeGobEncode ¶
NodeGobEncode Encode for serialise
func (Node) OnFinalFailed ¶
OnFinalFailed implement retryit interface
func (Node) TimeToSleepOnNextFailed ¶
TimeToSleepOnNextFailed implement retryit interface
func (*Node) UnmarshalBinary ¶
UnmarshalBinary Implement unmarshall
type NodeRemove ¶
type NodeRemove struct {
// contains filtered or unexported fields
}
NodeRemove type of struct to remove node by name
type NodeRetry ¶
type NodeRetry interface { Init() Execute(context.Context) error GetData() Node SetData(Node) NodeRetry OnSuccess() error OnFailed(error) error TimeToSleepOnNextFailed(int) time.Duration OnFinalFailed(error) error }
NodeRetry NodeRetry struct
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
Queue Queue struct
func (*Queue) EnqueueExecAndRetry ¶
func (rq *Queue) EnqueueExecAndRetry(n interface{})
EnqueueExecAndRetry Enqueue node and exec
func (*Queue) Register ¶
func (rq *Queue) Register(i interface{}, success func(interface{}) error, failed func(interface{}, error), finalFailed func(interface{}, error))
Register Register default for type
func (*Queue) RemoveByName ¶
RemoveByName Remove a node by name