event

package
v0.12.5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEventSource = "not_used"

Variables

This section is empty.

Functions

This section is empty.

Types

type AppEventOpt

type AppEventOpt func(event *ApplicationEvent)

func WithAdditionalData

func WithAdditionalData(additionalData map[string]interface{}) AppEventOpt

func WithId

func WithId(id string) AppEventOpt

func WithPayload

func WithPayload(payload interface{}) AppEventOpt

func WithServiceCode

func WithServiceCode(serviceCode string) AppEventOpt

func WithSource

func WithSource(source string) AppEventOpt

type ApplicationEvent

type ApplicationEvent struct {
	Id             string                 `json:"id"`
	Event          string                 `json:"event"`
	Source         string                 `json:"source"`
	ServiceCode    string                 `json:"service_code"`
	AdditionalData map[string]interface{} `json:"additional_data,omitempty"`
	PayloadData    interface{}            `json:"payload"`
	Timestamp      int64                  `json:"timestamp"`
}

func NewApplicationEvent

func NewApplicationEvent(name string, options ...AppEventOpt) *ApplicationEvent

func (*ApplicationEvent) AddAdditionData

func (a *ApplicationEvent) AddAdditionData(key string, value interface{})

func (*ApplicationEvent) DeleteAdditionData

func (a *ApplicationEvent) DeleteAdditionData(key string)

func (ApplicationEvent) Identifier

func (a ApplicationEvent) Identifier() string

func (ApplicationEvent) Name

func (a ApplicationEvent) Name() string

func (ApplicationEvent) Payload

func (a ApplicationEvent) Payload() interface{}

func (ApplicationEvent) String

func (a ApplicationEvent) String() string

func (ApplicationEvent) ToString

func (a ApplicationEvent) ToString(obj interface{}) string

type LogProperties

type LogProperties struct {
	NotLogPayloadForEvents []string
}

type Properties

type Properties struct {
	ChannelSize int `default:"10"`
	Log         LogProperties
}

func NewProperties

func NewProperties(loader config.Loader) (*Properties, error)

func (Properties) Prefix

func (p Properties) Prefix() string

Jump to

Keyboard shortcuts

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