Documentation ¶
Index ¶
- Constants
- func EncodeParams(in Params) []byte
- type Behavior
- type EnqueueOptions
- type Job
- type JobID
- type Kind
- type KindName
- type NoParams
- type Params
- type Persistence
- type Request
- type Schema
- func (scm *Schema) Define(kindName string, inOrFunc any, behavior Behavior, opts ...any) *Kind
- func (scm *Schema) EphemeralKindNames() []string
- func (scm *Schema) Include(peer *Schema)
- func (schema *Schema) KindByName(kindName string) *Kind
- func (scm *Schema) Kinds() []*Kind
- func (scm *Schema) PersistentKindNames() []string
- type Set
- type Status
- type WithEnabled
- type WithRepeatInterval
Constants ¶
View Source
const ( Idempotent = Behavior(0) Repeatable = Behavior(1) Cron = Behavior(2) )
Variables ¶
This section is empty.
Functions ¶
func EncodeParams ¶
Types ¶
type Behavior ¶
type Behavior int
func ParseBehavior ¶
func (*Behavior) DecodeMsgpack ¶
func (Behavior) EncodeMsgpack ¶
func (Behavior) IsRepeatable ¶
func (Behavior) MarshalText ¶
func (*Behavior) UnmarshalText ¶
type EnqueueOptions ¶
type Job ¶
type Job struct { ID JobID `msgpack:"-"` Kind string `msgpack:"k"` Name string `msgpack:"n"` RawParams json.RawMessage `msgpack:"p"` Status Status `msgpack:"s2,omitempty"` NextRunTime time.Time `msgpack:"rt,omitempty"` Step string `msgpack:"sp,omitempty"` RawState []byte `msgpack:"st,omitempty"` EnqueueTime time.Time `msgpack:"tq,omitempty"` StartTime time.Time `msgpack:"ts,omitempty"` LastAttemptTime time.Time `msgpack:"ta,omitempty"` FinishTime time.Time `msgpack:"tf,omitempty"` LastSuccessTime time.Time `msgpack:"tls,omitempty"` LastFailureTime time.Time `msgpack:"tlf,omitempty"` Attempt int `msgpack:"a,omitempty"` ConsecFailures int `msgpack:"failc,omitempty"` TotalFailures int `msgpack:"failt,omitempty"` LastErr string `msgpack:"errl,omitempty"` LastDuration time.Duration `msgpack:"durl,omitempty"` TotalDuration time.Duration `msgpack:"durt,omitempty"` }
func (*Job) IsAnonymous ¶
type Kind ¶
type Kind struct { Name string Behavior Behavior Persistence Persistence Method *mvprpc.Method Set string RepeatInterval time.Duration Backoff backoff.Backoff Enabled bool Handler any // contains filtered or unexported fields }
func (*Kind) AllowNames ¶
func (*Kind) IsPersistent ¶ added in v0.2.2
type KindName ¶
func (KindName) IsAnonymous ¶
type Persistence ¶
type Persistence int
const ( Persistent Persistence = 1 Ephemeral Persistence = 2 )
func ParsePersistence ¶
func ParsePersistence(s string) (Persistence, error)
func (*Persistence) DecodeMsgpack ¶
func (v *Persistence) DecodeMsgpack(dec *msgpack.Decoder) error
func (Persistence) EncodeMsgpack ¶
func (v Persistence) EncodeMsgpack(enc *msgpack.Encoder) error
func (Persistence) MarshalText ¶
func (v Persistence) MarshalText() ([]byte, error)
func (Persistence) String ¶
func (v Persistence) String() string
func (*Persistence) UnmarshalText ¶
func (v *Persistence) UnmarshalText(b []byte) error
type Request ¶
type Request struct { Kind string `msgpack:"k"` Name string `msgpack:"n"` Params json.RawMessage `msgpack:"p"` EnqueueOptions }
type Schema ¶
type Schema struct { Name string // contains filtered or unexported fields }
func (*Schema) EphemeralKindNames ¶ added in v0.2.2
func (*Schema) KindByName ¶
func (*Schema) PersistentKindNames ¶ added in v0.2.2
type Status ¶
type Status int
func ParseStatus ¶
func (Status) IsTerminal ¶
func (Status) MarshalText ¶
func (*Status) UnmarshalText ¶
type WithEnabled ¶ added in v0.2.2
type WithEnabled bool
type WithRepeatInterval ¶ added in v0.2.2
Click to show internal directories.
Click to hide internal directories.