Documentation ¶
Index ¶
- Variables
- type Shielded
- type Task
- type TaskAction
- type TaskGroup
- type TaskGroupResult
- type TaskParameters
- type TaskResult
- type TaskStatus
- type TaskedLock
- type Tracer
- func (t *Tracer) GoingIn() *Tracer
- func (t *Tracer) GoingInMessage() string
- func (t *Tracer) GoingOut() *Tracer
- func (t *Tracer) GoingOutMessage() string
- func (t *Tracer) OnExitTrace() func()
- func (t *Tracer) Stopwatch() temporal.Stopwatch
- func (t *Tracer) Trace(format string, a ...interface{}) *Tracer
- func (t *Tracer) TraceMessage(format string, a ...interface{}) string
- func (t *Tracer) WithStopwatch() *Tracer
Constants ¶
This section is empty.
Variables ¶
var Trace = struct { Locks bool Tasks bool }{ false, false, }
Trace contains what component in the package to trace
Functions ¶
This section is empty.
Types ¶
type Shielded ¶
type Shielded struct {
// contains filtered or unexported fields
}
Shielded allows to store data with controlled access to it
func NewShielded ¶
NewShielded creates a new protected data
type Task ¶
type Task interface { Abort() Aborted() bool ForceID(string) (Task, error) GetID() (string, error) GetSignature() string GetStatus() TaskStatus GetContext() context.Context Lock(TaskedLock) RLock(TaskedLock) Unlock(TaskedLock) RUnlock(TaskedLock) New() (Task, error) Reset() (Task, error) // GetResult() TaskResult Run(TaskAction, TaskParameters) (TaskResult, error) Start(TaskAction, TaskParameters) (Task, error) // StoreResult(TaskParameters) TryWait() (bool, TaskResult, error) Wait() (TaskResult, error) }
Task ...
func NewTaskGroupWithContext ¶
NewTaskGroupWithContext ...
func NewTaskWithContext ¶
NewTaskWithContext ...
type TaskAction ¶
type TaskAction func(t Task, parameters TaskParameters) (TaskResult, error)
TaskAction ...
type TaskGroup ¶
type TaskGroup interface { TryWait() (bool, map[string]TaskResult, error) Wait() (map[string]TaskResult, error) WaitFor(time.Duration) (bool, map[string]TaskResult, error) }
TaskGroup is the task group interface
type TaskGroupResult ¶
type TaskGroupResult map[string]TaskResult
TaskGroupResult is a map of the TaskResult of each task The index is the ID of the sub-Task running the action.
type TaskStatus ¶
type TaskStatus int
TaskStatus ...
const ( // READY the task is ready to start READY TaskStatus // RUNNING the task is running RUNNING // DONE the task has run and is done DONE // ABORTED the task has been aborted ABORTED )
type TaskedLock ¶
type TaskedLock interface { RLock(Task) RUnlock(Task) Lock(Task) Unlock(Task) IsRLocked(Task) bool IsLocked(Task) bool }
TaskedLock ...
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer ...
func (*Tracer) GoingIn ¶
GoingIn logs the input message (signifying we are going in) using TRACE level
func (*Tracer) GoingInMessage ¶
GoingInMessage returns the content of the message when entering the function
func (*Tracer) GoingOut ¶
GoingOut logs the output message (signifying we are going out) using TRACE level and adds duration if WithStopwatch() has been called.
func (*Tracer) GoingOutMessage ¶
GoingOutMessage returns the content of the message when exiting the function
func (*Tracer) OnExitTrace ¶
func (t *Tracer) OnExitTrace() func()
OnExitTrace returns a function that will log the output message using TRACE level.
func (*Tracer) Stopwatch ¶
Stopwatch returns the stopwatch used (if a stopwatch has been asked with WithStopwatch() )
func (*Tracer) TraceMessage ¶
TraceMessage returns a string containing a trace message
func (*Tracer) WithStopwatch ¶
WithStopwatch will add a measure of duration between GoingIn and GoingOut. GoingOut will add the elapsed time in the log message (if it has to be logged...).