events

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxMetaSize func() int64

dconfig.go

View Source
var NewEvent func(uuid UUID, kind Kind, category []Category, action Action) IEvent

event_new.go

View Source
var NewEvent2 func(opts NewEventArgs) IEvent
View Source
var NewEvent3 func(opts EventCloneOpts) IEvent
View Source
var NewMeta func(value map[string]any) IMeta

meta.go

View Source
var NewMeta2 func(value map[string]any, size int64) IMeta
View Source
var SetCommandSignature func(ctx context.Context, rawEvent *RawEvent, cmdId int64) error

utils.go

View Source
var SetEventDataFunc func(cfg IEngineConfig, fn DataProto) error
View Source
var SetEventSetDataFunc func(cfg IEngineConfig, fn SetDataProto) error
View Source
var SetEventSetDataRawFunc func(cfg IEngineConfig, fn SetDataProto) error

Functions

func Meta

func Meta[R any, T IMetaSource](metaSource T) (res R)

func MetaSetValue

func MetaSetValue[R any, T IMetaSource](metaSource T, key string, value R) error

func MetaTryValue

func MetaTryValue[R any, T IMetaSource](metaSource T, key string, d ...R) (res R, ok bool)

func MetaValue

func MetaValue[R any, T IMetaSource](metaSource T, key string, d ...R) (res R)

func MetaValueOrErr

func MetaValueOrErr[R any, T IMetaSource](metaSource T, key string) (res R, err error)

func TryMeta

func TryMeta[R any, T IMetaSource](metaSource T) (res R, ok bool)

Types

type Action

type Action = include.EventAction

type Category

type Category = include.EventCategory

func NormalizeCategory

func NormalizeCategory[T constraints.Integer](category []T) []Category

type DataProto

type DataProto = include.EventDataProto

type DataType

type DataType = include.EventDataType

type Event2MapOpts

type Event2MapOpts = include.Event2MapOpts

type EventCloneOpts

type EventCloneOpts = include.EventCloneOpts

type ICommandSignature

type ICommandSignature = include.ICommandSignature

type IData

type IData = include.IData

type IDataFromFile

type IDataFromFile = include.IDataFromFile

type IDataFromMem

type IDataFromMem = include.IDataFromMem

type IEngine

type IEngine = include.IEngine

type IEngineConfig

type IEngineConfig = include.IEngineConfig

type IEvent

type IEvent = include.IEvent

type IMeta

type IMeta = include.IMeta

type IMetaSource

type IMetaSource = include.IMetaSource

type Kind

type Kind = include.EventKind

type NewEventArgs

type NewEventArgs = include.NewEventArgs

type Opt

type Opt = include.EventOpt

type OwnerType

type OwnerType = include.EventOwnerType

type Priority

type Priority = include.EventPriority

type RawEvent

type RawEvent struct {
	// Уникальный идентификатор
	VirtualUuid UUID `json:"virtual_uuid" xml:"virtual_uuid" form:"virtual_uuid"`
	// Уникальный тег
	Uuid UUID `json:"uuid" xml:"uuid" form:"uuid"`
	// Вид (направление) ивента (number)
	Kind Kind `json:"kind" xml:"kind" form:"kind"`
	// Категория ивента (number)
	Category []Category `json:"category" xml:"category" form:"category"`
	// Операция (number)
	Action Action `json:"action" xml:"action" form:"action"`
	// Тип ивента
	Type Type `json:"type" xml:"type" form:"type"`
	// Статус
	Status Status `json:"status,omitempty" xml:"status" form:"status"`
	// Приоритет
	Priority Priority `json:"priority,omitempty" xml:"priority" form:"priority"`
	// Метаданные
	Meta map[string]any `json:"meta" xml:"meta" form:"meta"`
	// Размер метаданных
	MetaSize int64 `json:"meta_size,omitempty" xml:"meta_size" form:"meta_size"`
	// Размер данных привязанных к ивенту
	DataSize int64 `json:"data_size" xml:"data_size" form:"data_size"`
	// Максимальный размер данных, который может содержать ивент.
	// Если значение не задано, оно определяется из конфига
	DataMaxSize int64 `json:"data_max_size" xml:"data_max_size" form:"data_max_size"`
	// Тип данных
	DataType DataType `json:"data_type,omitempty" xml:"data_type" form:"data_type"`
	// Владелец
	OwnerUuid UUID `json:"owner_uuid" xml:"owner_uuid" form:"owner_uuid"`
	// Тип владелеца
	OwnerType OwnerType `json:"owner_type" xml:"owner_type" form:"owner_type"`
	// Время создания
	Created int64 `json:"created,omitempty" xml:"created" form:"created"`
	// Время когда ивент станет просроченным
	Expired int64 `json:"expired,omitempty" xml:"expired" form:"expired"`
	// Произвольные настройки. Могут отсутствовать.
	// Настраиваются кодом, в момент получения ивента.
	Opts map[Opt]any
}

func (*RawEvent) CommandSignature

func (w *RawEvent) CommandSignature() ICommandSignature

func (*RawEvent) Event

func (w *RawEvent) Event() (event IEvent, err error)

func (*RawEvent) SetCommandSignature

func (w *RawEvent) SetCommandSignature(sig ICommandSignature)

type SetDataProto

type SetDataProto = include.EventSetDataProto

type Status

type Status = include.EventStatus

type Type

type Type = include.EventType

type UUID

type UUID = include.UUID

Jump to

Keyboard shortcuts

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