resilience

package
v1.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	EVENT_RESILIENCE_STATUS  = "resilience:status"
	EVENT_RESILIENCE_STOP    = "resilience:stop"
	EVENT_RESILIENCE_RESTART = "resilience:restart"
	EVENT_RESILIENCE_FAILED  = "resilience:failed"
)
View Source
const (
	MSG_RESILIENCE_NOT_INITIALIZED = "resilience no esta inicializado"
	MSG_ID_REQUIRED                = "id es requerido"
	MSG_ID_NOT_FOUND               = "id no encontrado"
	MSG_INSTANCE_STOPPED           = "intento detenido"
	MSG_INSTANCE_RESTARTED         = "intento reiniciado"
	MSG_INSTANCE_NOT_FOUND         = "intento no encontrado"
	MSG_RESILIENCE_STATUS          = "Attempt:%d de %d Instance:%s, Tag:%s Status:%s"
	MSG_RESILIENCE_ERROR           = "Attempt:%d de %d Error en Instance:%s Tag:%s Status:%s, Error:%s"
	MSG_RESILIENCE_FINISHED        = "Attempt:%d de %d Finalizado Instance:%s Tag:%s Status:%s"
	MSG_RESILIENCE_FINISHED_ERROR  = "Attempt:%d de %d Finalizado con error Instance:%s Tag:%s Status:%s, Error:%s"
)
View Source
const (
	TpStoreCache  TpStore = "cache"
	TpStoreMemory TpStore = "memory"
	StatusPending Status  = "pending"
	StatusRunning Status  = "running"
	StatusDone    Status  = "done"
	StatusStop    Status  = "stop"
	StatusFailed  Status  = "failed"
)

Variables

This section is empty.

Functions

func HealthCheck added in v0.1.18

func HealthCheck() bool

* * HealthCheck * @return bool *

func HttpGetResilienceById

func HttpGetResilienceById(w http.ResponseWriter, r *http.Request)

* * HttpGetResilienceById * @param w http.ResponseWriter, r *http.Request *

func HttpGetResilienceRestart added in v0.1.18

func HttpGetResilienceRestart(w http.ResponseWriter, r *http.Request)

* * HttpGetResilienceRestart * @param w http.ResponseWriter, r *http.Request *

func HttpGetResilienceStop added in v0.1.18

func HttpGetResilienceStop(w http.ResponseWriter, r *http.Request)

* * HttpGetResilienceStop * @param w http.ResponseWriter, r *http.Request *

func Restart added in v0.1.18

func Restart(id string) error

* * Restart * @param id string * @return error

func Stop added in v0.1.18

func Stop(id string) error

* * Stop * @param id string * @return error

Types

type Instance added in v0.1.18

type Instance struct {
	CreatedAt     time.Time     `json:"created_at"`
	UpdatedAt     time.Time     `json:"updated_at"`
	LastAttemptAt time.Time     `json:"last_attempt_at"`
	DoneAt        time.Time     `json:"done_at"`
	Id            string        `json:"id"`
	Tag           string        `json:"tag"`
	Description   string        `json:"description"`
	Status        Status        `json:"status"`
	TpStore       TpStore       `json:"store"`
	Attempt       int           `json:"attempt"`
	TotalAttempts int           `json:"total_attempts"`
	TimeAttempts  time.Duration `json:"time_attempts"`
	RetentionTime time.Duration `json:"retention_time"`
	Tags          et.Json       `json:"tags"`
	Team          string        `json:"team"`
	Level         string        `json:"level"`
	// contains filtered or unexported fields
}

func Add

func Add(id, tag, description string, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{}) *Instance

* * Add * @param tag, description string, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{} * @return *Instance

func AddCustom added in v0.1.18

func AddCustom(id, tag, description string, totalAttempts int, timeAttempts, retentionTime time.Duration, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{}) *Instance

* * AddCustom * @param id, tag, description string, totalAttempts int, timeAttempts, retentionTime time.Duration, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{} * @return *Instance

func LoadById added in v0.1.18

func LoadById(id string) (*Instance, error)

* * LoadById * @param id string * @return *Instance, error *

func NewInstance added in v0.1.18

func NewInstance(id, tag, description string, totalAttempts int, timeAttempts, retentionTime time.Duration, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{}) *Instance

* * Instance * @param id, tag, description string, totalAttempts int, timeAttempts, retentionTime time.Duration, tags et.Json, team string, level string, fn interface{}, fnArgs ...interface{} * @return Instance

func (*Instance) IsEnd added in v0.1.18

func (s *Instance) IsEnd() bool

* * IsEnd * @return bool *

func (*Instance) IsFailed added in v0.1.18

func (s *Instance) IsFailed() bool

* * IsFailed * @return bool *

func (*Instance) ToJson added in v0.1.18

func (s *Instance) ToJson() et.Json

* * ToJson * @return et.Json *

type Status added in v0.1.18

type Status string

type TpStore added in v0.1.18

type TpStore string

Jump to

Keyboard shortcuts

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