item

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package item implements the faces.IItem interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.0.3

func New(ctx context.Context, tr faces.ITrace) faces.IItem

New is a constructor.

Types

type Data

type Data struct {
	// contains filtered or unexported fields
}

Data is internal item's storage. It exits as property of Item for OOP/inheritance goals.

type Item

type Item struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Item implements the faces.IItem interface.

func (*Item) AddError

func (i *Item) AddError(err error)

AddError fix error in item and push to logger if it's possible.

func (*Item) AfterProcess added in v0.0.12

func (i *Item) AfterProcess(_ faces.Name, _ error)

AfterProcess does nothing. It should be redefined.

func (*Item) BeforeProcess added in v0.0.12

func (i *Item) BeforeProcess(_ faces.Name)

BeforeProcess does nothing. It should be redefined.

func (*Item) Cancel added in v0.0.3

func (i *Item) Cancel()

Cancel emergency breaks the processing by global context.

func (*Item) CleanError

func (i *Item) CleanError()

CleanError just removes error from item.

func (*Item) Finish

func (i *Item) Finish()

Finish writes tracer for item and flush the tracer.

func (*Item) Get

func (i *Item) Get() interface{}

Get is a interface function. It's a simple getter.

func (*Item) GetContext

func (i *Item) GetContext() context.Context

GetContext is a interface function. It's a simple getter.

func (*Item) GetError

func (i *Item) GetError() error

GetError is a interface function. It's a simple getter.

func (*Item) GetHandlerError

func (i *Item) GetHandlerError() faces.Name

GetHandlerError returns the error which got within processing of the item.

func (*Item) GetID

func (i *Item) GetID() int64

GetID is a interface function. It's a simple getter.

func (*Item) GetLastHandler

func (i *Item) GetLastHandler() faces.Name

GetLastHandler returns the last handler name which processed the item.

func (*Item) GetPriority

func (i *Item) GetPriority() int

GetPriority returns priority for item.

func (*Item) GetSkipNames added in v0.0.10

func (i *Item) GetSkipNames() []faces.Name

GetSkipNames returns handler name which was set up with SetSkipNames.

func (*Item) GetSkipToName

func (i *Item) GetSkipToName() faces.Name

GetSkipToName returns handler name which was set up with SetSkipToName and is not yet processed.

func (*Item) GetTestObject added in v0.0.21

func (i *Item) GetTestObject() faces.ITestObject

GetTestObject is a interface function. It's a simple getter.

func (*Item) Init

func (i *Item) Init(ctxIn context.Context, tr faces.ITrace) faces.IItem

Init is full constructor for accurate configuration.

func (*Item) InitEmpty added in v0.1.1

func (i *Item) InitEmpty()

InitEmpty makes empty item.

func (*Item) IsStopped added in v0.2.2

func (i *Item) IsStopped() bool

IsStopped indicates that item should only be processed by the Final or Error Handlers

func (*Item) LogTraceFinishTimef added in v0.1.0

func (i *Item) LogTraceFinishTimef(format string, a ...interface{})

LogTraceFinishTimef adds the message and during of period from last call of item.LogTraceFinishTimef or item.Start to tracer.

func (*Item) LogTracef added in v0.1.0

func (i *Item) LogTracef(format string, a ...interface{})

LogTracef pushes message to tracer.

func (*Item) NeedToSkip added in v0.0.3

func (i *Item) NeedToSkip(worker faces.IWorker) (bool, error)

NeedToSkip checks should be handler skipped or not.

func (*Item) PushedToChannel added in v0.0.10

func (i *Item) PushedToChannel(_ faces.Name)

PushedToChannel does nothing. It should be redefined.

func (*Item) ReceivedFromChannel added in v0.0.10

func (i *Item) ReceivedFromChannel()

ReceivedFromChannel does nothing. It should be redefined.

func (*Item) Set

func (i *Item) Set(data interface{})

Set is a simple setter. It sets up the data of item.

func (*Item) SetHandlerError

func (i *Item) SetHandlerError(handlerNameWithError faces.Name)

SetHandlerError sets the error which got within processing of the item.

func (*Item) SetID

func (i *Item) SetID(id int64)

SetID is a simple setter.

func (*Item) SetLastHandler

func (i *Item) SetLastHandler(handlerName faces.Name)

SetLastHandler sets the last handler name which processed the item.

func (*Item) SetLock added in v0.0.19

func (i *Item) SetLock()

SetLock is a interface function.

func (*Item) SetPriority

func (i *Item) SetPriority(priority int)

SetPriority sets priority for item if priority queue is used.

func (*Item) SetSkipNames added in v0.0.10

func (i *Item) SetSkipNames(names ...faces.Name)

SetSkipNames sets the handler names. Conveyor skips all these handlers.

func (*Item) SetSkipToName

func (i *Item) SetSkipToName(name faces.Name)

SetSkipToName sets the handler name. Conveyor skips all handlers until that. When conveyor reaches that name is set up as EmptySkipName. If conveyor finishes and name is not found item gets error.

func (*Item) SetTestObject added in v0.0.21

func (i *Item) SetTestObject(testObject faces.ITestObject)

SetTestObject is a interface function. It's a setter. It sets up the Empty test object if it gets nil input parameter.

func (*Item) SetUnlock added in v0.0.19

func (i *Item) SetUnlock()

SetUnlock is a interface function.

func (*Item) Start

func (i *Item) Start()

Start restarts the timers for measuring the periods for each stage of process and whole process.

func (*Item) Stopped added in v0.2.2

func (i *Item) Stopped()

Stopped sets up that item should only be processed by the Final or Error Handlers

Jump to

Keyboard shortcuts

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