resilience

package
v1.1.113 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 Load

func Load() error

* * Load * @return error

func SetContactNumbers added in v1.1.96

func SetContactNumbers(contactNumbers []string)

* * SetContactNumbers * @param contactNumbers []string

func SetContentEmail added in v1.1.96

func SetContentEmail(subject string, htmlMessage string, params []et.Json)

* * SetContentEmail * @param subject string, htmlMessage string, params []et.Json

func SetContentSMS added in v1.1.96

func SetContentSMS(content string, params []et.Json)

* * SetContentSMS * @param content string, params []et.Json

func SetEmails added in v1.1.96

func SetEmails(emails []et.Json)

* * SetEmails * @param emails []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 NewResilence

func NewResilence() *Resilence

* * NewResilence * @return *Resilience

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) Json added in v1.1.87

func (s *Resilence) Json() et.Json

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

func (s *Resilence) SetContactNumbers(contactNumbers []string)

* * SetContactNumbers * @param contactNumbers []string

func (*Resilence) SetContentEmail added in v1.1.96

func (s *Resilence) SetContentEmail(subject string, htmlMessage string, params []et.Json)

* * SetSubject * @param subject string

func (*Resilence) SetContentSMS added in v1.1.96

func (s *Resilence) SetContentSMS(content string, params []et.Json)

* * SetContentSMS * @param content string, params []et.Json

func (*Resilence) SetEmails added in v1.1.95

func (s *Resilence) SetEmails(emails []et.Json)

* * SetEmails * @param emails []et.Json

func (*Resilence) SetNotifyType added in v1.1.95

func (s *Resilence) SetNotifyType(notifyType TpNotify)

func (*Resilence) SetTemplateId added in v1.1.95

func (s *Resilence) SetTemplateId(templateId int)

* * SetTemplateId * @param templateId int

type Store added in v1.1.87

type Store int
const (
	StoreCache Store = iota
	StoreMemory
)

func (Store) String added in v1.1.87

func (s Store) String() string

type TpNotify added in v1.1.95

type TpNotify int
const (
	TpNotifySms TpNotify = iota
	TpNotifyEmail
	TpNotifyWhatsapp
)

func (TpNotify) String added in v1.1.96

func (s TpNotify) String() string

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 *

func (*Transaction) Json

func (s *Transaction) Json() et.Json

* * Json * @return et.Json *

func (*Transaction) Run added in v1.1.87

func (s *Transaction) Run() ([]reflect.Value, error)

* * Run * @return error *

type TransactionStatus

type TransactionStatus string
const (
	StatusPending TransactionStatus = "pending"
	StatusSuccess TransactionStatus = "success"
	StatusRunning TransactionStatus = "running"
	StatusFailed  TransactionStatus = "failed"
)

Jump to

Keyboard shortcuts

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