Documentation
¶
Index ¶
- func HttpGetResilience(w http.ResponseWriter, r *http.Request)
- func HttpGetResilienceById(w http.ResponseWriter, r *http.Request)
- func HttpGetResilienceByTag(w http.ResponseWriter, r *http.Request)
- func Load() error
- func SetContactNumbers(contactNumbers []string)
- func SetContentEmail(subject string, htmlMessage string, params []et.Json)
- func SetContentSMS(content string, params []et.Json)
- func SetEmails(emails []et.Json)
- func SetNotifyType(notifyType TpNotify)
- func SetTemplateId(templateId int)
- type Resilence
- func (s *Resilence) Done(transaction *Transaction)
- func (s *Resilence) GetById(id string) *Transaction
- func (s *Resilence) GetByTag(tag string) *Transaction
- func (s *Resilence) Json() et.Json
- func (s *Resilence) Notify(transaction *Transaction)
- func (s *Resilence) Run(transaction *Transaction)
- func (s *Resilence) SetContactNumbers(contactNumbers []string)
- func (s *Resilence) SetContentEmail(subject string, htmlMessage string, params []et.Json)
- func (s *Resilence) SetContentSMS(content string, params []et.Json)
- func (s *Resilence) SetEmails(emails []et.Json)
- func (s *Resilence) SetNotifyType(notifyType TpNotify)
- func (s *Resilence) SetTemplateId(templateId int)
- type Store
- type TpNotify
- type Transaction
- type TransactionStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HttpGetResilience ¶ added in v1.1.87
func HttpGetResilience(w http.ResponseWriter, r *http.Request)
* * HttpGetResilience * @param w http.ResponseWriter, r *http.Request *
func HttpGetResilienceById ¶ added in v1.1.87
func HttpGetResilienceById(w http.ResponseWriter, r *http.Request)
* * HttpGetResilienceById * @param w http.ResponseWriter, r *http.Request *
func HttpGetResilienceByTag ¶ added in v1.1.87
func HttpGetResilienceByTag(w http.ResponseWriter, r *http.Request)
* * HttpGetResilienceByTag * @param w http.ResponseWriter, r *http.Request *
func SetContactNumbers ¶ added in v1.1.96
func SetContactNumbers(contactNumbers []string)
* * SetContactNumbers * @param contactNumbers []string
func SetContentEmail ¶ added in v1.1.96
* * SetContentEmail * @param subject string, htmlMessage string, params []et.Json
func SetContentSMS ¶ added in v1.1.96
* * SetContentSMS * @param content string, params []et.Json
func SetNotifyType ¶ added in v1.1.96
func SetNotifyType(notifyType TpNotify)
* * SetNotifyType * @param notifyType TpNotify
func SetTemplateId ¶ added in v1.1.96
func SetTemplateId(templateId int)
* * SetTemplateId * @param templateId int
Types ¶
type Resilence ¶
type Resilence struct {
CreatedAt time.Time
Id string
Transactions []*Transaction
Attempts int
TimeAttempts time.Duration
NotifyType TpNotify
ContactNumbers []string
Emails []et.Json
TemplateId int
Content string
Subject string
HtmlMessage string
Params []et.Json
}
func (*Resilence) Done ¶ added in v1.1.87
func (s *Resilence) Done(transaction *Transaction)
* * Done * @param transaction *Transaction
func (*Resilence) GetById ¶ added in v1.1.87
func (s *Resilence) GetById(id string) *Transaction
* * GetById * @param id string * @return *Transaction
func (*Resilence) GetByTag ¶ added in v1.1.87
func (s *Resilence) GetByTag(tag string) *Transaction
* * GetByTag * @param tag string * @return *Transaction
func (*Resilence) Notify ¶ added in v1.1.87
func (s *Resilence) Notify(transaction *Transaction)
* * Notify * @param transaction *Transaction
func (*Resilence) Run ¶ added in v1.1.87
func (s *Resilence) Run(transaction *Transaction)
* * Run * @param transaction *Transaction
func (*Resilence) SetContactNumbers ¶ added in v1.1.94
* * SetContactNumbers * @param contactNumbers []string
func (*Resilence) SetContentEmail ¶ added in v1.1.96
* * SetSubject * @param subject string
func (*Resilence) SetContentSMS ¶ added in v1.1.96
* * SetContentSMS * @param content string, params []et.Json
func (*Resilence) SetNotifyType ¶ added in v1.1.95
func (*Resilence) SetTemplateId ¶ added in v1.1.95
* * SetTemplateId * @param templateId int
type Transaction ¶
type Transaction struct {
CreatedAt time.Time `json:"created_at"`
LastAttemptAt time.Time `json:"last_attempt_at"`
Id string `json:"id"`
Tag string `json:"tag"`
Description string `json:"description"`
Status TransactionStatus `json:"status"`
Store Store `json:"store"`
Attempts int `json:"attempts"`
// contains filtered or unexported fields
}
func Add ¶ added in v1.1.87
func Add(tag, description string, fn interface{}, fnArgs ...interface{}) *Transaction
* * Add * @param tag, description string, fn interface{}, fnArgs ...interface{} * @return *Transaction
func NewTransaction ¶
func NewTransaction(tag, description string, fn interface{}, fnArgs ...interface{}) *Transaction
* * Transaction * @param id, description string, fn interface{}, fnArgs ...interface{} * @return Transaction
func (*Transaction) Done ¶ added in v1.1.87
func (s *Transaction) Done() error
* * done * @return error *
type TransactionStatus ¶
type TransactionStatus string
const ( StatusPending TransactionStatus = "pending" StatusSuccess TransactionStatus = "success" StatusRunning TransactionStatus = "running" StatusFailed TransactionStatus = "failed" )