Documentation ¶
Index ¶
- Constants
- Variables
- type Adapter
- type BaseJournal
- func (j *BaseJournal) FindAll(entry *Entry) ([]*Entry, error)
- func (j *BaseJournal) GetContext() Contexter
- func (j *BaseJournal) GetContextUUID() *common.UUID
- func (j *BaseJournal) GetTask() Tasker
- func (j *BaseJournal) GetTaskUUID() *common.UUID
- func (j *BaseJournal) Insert(entry *Entry) error
- func (j *BaseJournal) Lookup(address *common.Address)
- func (j *BaseJournal) LookupError(address *common.Address, callErr error)
- func (j *BaseJournal) NewEntry(entryType int32) *Entry
- func (j *BaseJournal) ProcessData(address *common.Address, size int64, metadata *common.Metadata)
- func (j *BaseJournal) ProcessDataError(callErr error)
- func (j *BaseJournal) ProcessTask(task *common.Task)
- func (j *BaseJournal) ProcessTaskError(task *common.Task, callErr error)
- func (j *BaseJournal) RequestEnd()
- func (j *BaseJournal) RequestError(callErr error)
- func (j *BaseJournal) RequestStart()
- func (j *BaseJournal) Result(address *common.Address, size int64, metadata *common.Metadata)
- func (j *BaseJournal) SaveData(address *common.Address, size int64, metadata *common.Metadata, data []byte)
- func (j *BaseJournal) SaveDataError(callErr error)
- func (j *BaseJournal) SaveTask(task *common.Task)
- func (j *BaseJournal) SaveTaskError(task *common.Task, callErr error)
- func (j *BaseJournal) SetContext(ctx Contexter) Journaller
- func (j *BaseJournal) SetTask(task Tasker) Journaller
- func (j *BaseJournal) WithContext(ctx Contexter) Journaller
- func (j *BaseJournal) WithTask(task Tasker) Journaller
- type Contexter
- type DefaultJournal
- type Entry
- func (e *Entry) EnsureObjectMetadata() *common.Metadata
- func (e *Entry) InsertInto(j Journaller)
- func (e *Entry) SetBaseInfo(start time.Time, endpoint int32, endpointInstanceID *common.UUID, ...) *Entry
- func (e *Entry) SetCtxUID(ctxUID *common.UUID) *Entry
- func (e *Entry) SetEndpointID(endpoint int32) *Entry
- func (e *Entry) SetEndpointInstanceID(endpointInstanceID *common.UUID) *Entry
- func (e *Entry) SetError(err error) *Entry
- func (e *Entry) SetObject(objectType int32, address *common.Address, size uint64, ...) *Entry
- func (e *Entry) SetObjectAddress(address *common.Address) *Entry
- func (e *Entry) SetObjectData(data []byte) *Entry
- func (e *Entry) SetObjectMetadata(metadata *common.Metadata) *Entry
- func (e *Entry) SetObjectSize(size uint64) *Entry
- func (e *Entry) SetObjectType(objectType int32) *Entry
- func (e *Entry) SetResult(result string) *Entry
- func (e *Entry) SetSourceID(userID *common.UserID) *Entry
- func (e *Entry) SetStatus(status string) *Entry
- func (e *Entry) SetTaskUID(taskUID *common.UUID) *Entry
- func (e *Entry) SetType(_type int32) *Entry
- func (e *Entry) String() string
- type Journaller
- type NOPJournal
- func (j *NOPJournal) FindAll(entry *Entry) ([]*Entry, error)
- func (j *NOPJournal) Insert(entry *Entry) error
- func (j *NOPJournal) Lookup(address *common.Address)
- func (j *NOPJournal) LookupError(address *common.Address, callErr error)
- func (j *NOPJournal) NewEntry(action int32) *Entry
- func (j *NOPJournal) ProcessData(address *common.Address, size int64, metadata *common.Metadata)
- func (j *NOPJournal) ProcessDataError(callErr error)
- func (j *NOPJournal) ProcessTask(task *common.Task)
- func (j *NOPJournal) ProcessTaskError(task *common.Task, callErr error)
- func (j *NOPJournal) RequestEnd()
- func (j *NOPJournal) RequestError(callErr error)
- func (j *NOPJournal) RequestStart()
- func (j *NOPJournal) Result(address *common.Address, size int64, metadata *common.Metadata)
- func (j *NOPJournal) SaveData(address *common.Address, size int64, metadata *common.Metadata, data []byte)
- func (j *NOPJournal) SaveDataError(callErr error)
- func (j *NOPJournal) SaveTask(task *common.Task)
- func (j *NOPJournal) SaveTaskError(task *common.Task, callErr error)
- func (j *NOPJournal) SetContext(ctx Contexter) Journaller
- func (j *NOPJournal) SetTask(task Tasker) Journaller
- func (j *NOPJournal) WithContext(ctx Contexter) Journaller
- func (j *NOPJournal) WithTask(task Tasker) Journaller
- type Tasker
Constants ¶
const ( // EndpointUnknown specifies initial unknown endpoint EndpointUnknown int32 = 0 // NoPlane section NoPlane int32 = 0 NoPlaneCustom = NoPlane + 2000 // ControlPlane section ControlPlane int32 = 0 EndpointTasks = ControlPlane + 100 ControlPlaneCustom = ControlPlane + 2000 // DataPlane section DataPlane int32 = 3000 EndpointDataChunks = DataPlane + 100 EndpointUploadObject = DataPlane + 200 EndpointUploadObjects = DataPlane + 300 EndpointDownloadObject = DataPlane + 400 EndpointDownloadObjects = DataPlane + 500 DataPlaneCustom = DataPlane + 2000 // HealthPlane section HealthPlane int32 = 6000 EndpointMetrics = HealthPlane + 100 EndpointStatusObject = HealthPlane + 200 EndpointStatusObjects = HealthPlane + 300 HealthPlaneCustom = HealthPlane + 2000 // ReportsPlane section ReportsPlane int32 = 9000 EndpointReport = ReportsPlane + 100 EndpointReports = ReportsPlane + 200 ReportsPlaneCustom = ReportsPlane + 2000 )
const ( EntryTypeUnknown int32 = 0 EntryTypeRequestStart int32 = 1 EntryTypeSaveData int32 = 100 EntryTypeSaveDataError int32 = 101 EntryTypeProcessData int32 = 200 EntryTypeProcessDataError int32 = 201 EntryTypeResult int32 = 300 EntryTypeSaveTask int32 = 400 EntryTypeSaveTaskError int32 = 401 EntryTypeProcessTask int32 = 500 EntryTypeProcessTaskError int32 = 501 EntryTypeLookup int32 = 600 EntryTypeLookupError int32 = 601 EntryTypeRequestCompleted int32 = 10000 EntryTypeRequestError int32 = 10001 )
const (
ObjectTypeUnknown int32 = 0
)
Variables ¶
var (
EndpointTypeEnum = common.NewEnum()
)
var (
EntryTypeEnum = common.NewEnum()
)
var (
ObjectTypeEnum = common.NewEnum()
)
Functions ¶
This section is empty.
Types ¶
type BaseJournal ¶
type BaseJournal struct { NOPJournal // contains filtered or unexported fields }
BaseJournal
func NewBaseJournal ¶
func NewBaseJournal(endpointID int32, endpointInstanceID *common.UUID, adapter Adapter) (*BaseJournal, error)
NewBaseJournal
func (*BaseJournal) GetContextUUID ¶
func (j *BaseJournal) GetContextUUID() *common.UUID
GetContextUUID
func (*BaseJournal) LookupError ¶
func (j *BaseJournal) LookupError(address *common.Address, callErr error)
LookupError
func (*BaseJournal) ProcessData ¶
func (j *BaseJournal) ProcessData( address *common.Address, size int64, metadata *common.Metadata, )
ProcessData journals data processed successfully
func (*BaseJournal) ProcessDataError ¶
func (j *BaseJournal) ProcessDataError(callErr error)
ProcessDataError journals data not processed due to an error
func (*BaseJournal) ProcessTask ¶
func (j *BaseJournal) ProcessTask(task *common.Task)
ProcessTask journals task processed successfully
func (*BaseJournal) ProcessTaskError ¶
func (j *BaseJournal) ProcessTaskError(task *common.Task, callErr error)
ProcessTaskError journals task not processed due to an error
func (*BaseJournal) RequestEnd ¶
func (j *BaseJournal) RequestEnd()
RequestEnd journals request completed successfully
func (*BaseJournal) RequestError ¶
func (j *BaseJournal) RequestError(callErr error)
RequestError journals request has failed with an error
func (*BaseJournal) RequestStart ¶
func (j *BaseJournal) RequestStart()
RequestStart journals beginning of the request processing
func (*BaseJournal) SaveData ¶
func (j *BaseJournal) SaveData( address *common.Address, size int64, metadata *common.Metadata, data []byte, )
SaveData journals data saved successfully
func (*BaseJournal) SaveDataError ¶
func (j *BaseJournal) SaveDataError(callErr error)
SaveDataError journals data not saved due to an error
func (*BaseJournal) SaveTask ¶
func (j *BaseJournal) SaveTask(task *common.Task)
SaveTask journals task saved successfully
func (*BaseJournal) SaveTaskError ¶
func (j *BaseJournal) SaveTaskError(task *common.Task, callErr error)
SaveTaskError journals task not saved due to an error
func (*BaseJournal) SetContext ¶
func (j *BaseJournal) SetContext(ctx Contexter) Journaller
SetContext
func (*BaseJournal) WithContext ¶
func (j *BaseJournal) WithContext(ctx Contexter) Journaller
WithContext
type DefaultJournal ¶
type DefaultJournal struct {
NOPJournal
}
DefaultJournal provides empty implementations of all interface functions
type Entry ¶
type Entry struct { // Time of the entry/event Time time.Time // StartTime specifies start time of the action sequence or execution context StartTime time.Time // EndpointID [MANDATORY] specifies ID of the endpoint (API call handler/Task processor/etc) which produces the entry // See EndpointTypeEnum for available options. EndpointID int32 // EndpointInstanceID [OPTIONAL] specifies ID of the particular endpoint instance (ex.: process) which produces the entry // Elaborates EndpointID in terms of particular instance specification. EndpointInstanceID *common.UUID // SourceID [OPTIONAL] specifies ID of the source (possibly external) of the entry SourceID *common.UserID // ContextID [OPTIONAL] specifies ID of the execution/rpc context associated with the entry ContextUID *common.UUID // TaskID [OPTIONAL] specifies ID of the task associated with the entry TaskUID *common.UUID // Type [MANDATORY] specifies type of the entry - what this entry is about. // See EntryTypeEnum for available options. Type int32 // Object info tells about object, if any // ObjectType specified object type // See ObjectTypeEnum for available options. ObjectType int32 ObjectAddress *common.Address ObjectSize uint64 ObjectMetadata *common.Metadata ObjectData []byte // Result [OPTIONAL] specifies result of the operation, specified by Type Result string // Result [OPTIONAL] specifies status of the operation, specified by Type Status string // Error [OPTIONAL] tells about error encountered during the operation, specified by Type Error error }
Entry defines journal entry structure
func (*Entry) EnsureObjectMetadata ¶
EnsureObjectMetadata
func (*Entry) InsertInto ¶
func (e *Entry) InsertInto(j Journaller)
InsertInto inserts entry into a journal
func (*Entry) SetBaseInfo ¶
func (e *Entry) SetBaseInfo( start time.Time, endpoint int32, endpointInstanceID *common.UUID, ctxUID *common.UUID, taskUID *common.UUID, _type int32, ) *Entry
SetBaseInfo
func (*Entry) SetEndpointInstanceID ¶
SetEndpointIInstanceD
func (*Entry) SetObject ¶
func (e *Entry) SetObject( objectType int32, address *common.Address, size uint64, metadata *common.Metadata, data []byte, ) *Entry
SetObject
func (*Entry) SetObjectAddress ¶
SetObjectAddress
func (*Entry) SetObjectMetadata ¶
SetObjectMetadata
type Journaller ¶
type Journaller interface { SetContext(ctx Contexter) Journaller SetTask(task Tasker) Journaller WithContext(ctx Contexter) Journaller WithTask(task Tasker) Journaller NewEntry(action int32) *Entry Adapter RequestStart() RequestEnd() RequestError(callErr error) SaveData( address *common.Address, size int64, metadata *common.Metadata, data []byte, ) SaveDataError(callErr error) ProcessData( address *common.Address, size int64, metadata *common.Metadata, ) ProcessDataError(callErr error) Result( address *common.Address, size int64, metadata *common.Metadata, ) SaveTask(task *common.Task) SaveTaskError(task *common.Task, callErr error) ProcessTask(task *common.Task) ProcessTaskError(task *common.Task, callErr error) // // // Lookup(address *common.Address) LookupError(address *common.Address, callErr error) }
Journaller
type NOPJournal ¶
type NOPJournal struct {
// contains filtered or unexported fields
}
NOPJournal
func (*NOPJournal) LookupError ¶
func (j *NOPJournal) LookupError(address *common.Address, callErr error)
LookupError
func (*NOPJournal) ProcessData ¶
ProcessData journals data processed successfully
func (*NOPJournal) ProcessDataError ¶
func (j *NOPJournal) ProcessDataError(callErr error)
ProcessDataError journals data not processed due to an error
func (*NOPJournal) ProcessTask ¶
func (j *NOPJournal) ProcessTask(task *common.Task)
ProcessTask journals task processed successfully
func (*NOPJournal) ProcessTaskError ¶
func (j *NOPJournal) ProcessTaskError(task *common.Task, callErr error)
ProcessTaskError journals task not processed due to an error
func (*NOPJournal) RequestEnd ¶
func (j *NOPJournal) RequestEnd()
RequestCompleted journals request completed successfully
func (*NOPJournal) RequestError ¶
func (j *NOPJournal) RequestError(callErr error)
RequestError journals request error
func (*NOPJournal) RequestStart ¶
func (j *NOPJournal) RequestStart()
RequestStart journals beginning of the request processing
func (*NOPJournal) SaveData ¶
func (j *NOPJournal) SaveData( address *common.Address, size int64, metadata *common.Metadata, data []byte, )
SaveData journals data saved successfully
func (*NOPJournal) SaveDataError ¶
func (j *NOPJournal) SaveDataError(callErr error)
SaveDataError journals data not saved due to an error
func (*NOPJournal) SaveTask ¶
func (j *NOPJournal) SaveTask(task *common.Task)
SaveTask journals task saved successfully
func (*NOPJournal) SaveTaskError ¶
func (j *NOPJournal) SaveTaskError(task *common.Task, callErr error)
SaveTaskError journals task not saved due to an error
func (*NOPJournal) SetContext ¶
func (j *NOPJournal) SetContext(ctx Contexter) Journaller
SetContext
func (*NOPJournal) WithContext ¶
func (j *NOPJournal) WithContext(ctx Contexter) Journaller
WithContext