Documentation
¶
Index ¶
- type Body
- type Delay
- type Id
- type Job
- func (j *Job) GetDelayTimeFromNow() time.Time
- func (j *Job) GetName() string
- func (j *Job) GetNameWithVersion() NameVersion
- func (j *Job) GetTTRTimeFromNow() time.Time
- func (j *Job) IsValid() error
- func (j *Job) IsVersionSame(v Version) bool
- func (j *Job) Lock() error
- func (j *Job) Unlock() (bool, error)
- type NameVersion
- type TTR
- type Topic
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct { Topic Topic `json:"topic"` ID Id `json:"id"` Delay Delay `json:"delay"` TTR TTR `json:"ttr"` Body Body `json:"body"` Version Version `json:"version"` Mutex lock.Locker `json:"-"` }
func New ¶
func New(topic Topic, id Id, delay Delay, ttr TTR, body Body, lockerFunc lock.LockerFunc) (*Job, error)
New return a job with everything init
func (*Job) GetDelayTimeFromNow ¶
GetDelayTimeFromNow return how much time to wait for delaying
func (*Job) GetNameWithVersion ¶
func (j *Job) GetNameWithVersion() NameVersion
func (*Job) GetTTRTimeFromNow ¶
GetTTRTimeFromNow return how much time to wait until overtime
func (*Job) IsVersionSame ¶
IsVersionSame return whether j's version is equal to v
type NameVersion ¶
type NameVersion string
func NewNameVersion ¶
func NewNameVersion(topic Topic, id Id, version Version) NameVersion
func NewNameVersionString ¶
func NewNameVersionString(str string) NameVersion
func (NameVersion) MarshalBinary ¶
func (nv NameVersion) MarshalBinary() ([]byte, error)
type Version ¶
type Version struct {
// contains filtered or unexported fields
}
func LoadVersion ¶
func NewVersion ¶
func NewVersion() Version
func (Version) MarshalJSON ¶
func (*Version) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.