entities

package
v0.0.0-...-a136232 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEventIdWasSet     = errors.New("event id has set already")
	ErrEventTsWasSet     = errors.New("event timestamps has set already")
	ErrEventBucketWasSet = errors.New("event bucket has set already")
)

Functions

This section is empty.

Types

type Event

type Event struct {
	// partition keys, we often use the timestamp with format YYMMDD
	Bucket    string `json:"bucket" validate:"required"`
	Workspace string `json:"workspace" validate:"required"`
	App       string `json:"app" validate:"required"`
	Type      string `json:"type" validate:"required"`

	// clustering keys
	// chronologically sortable id - ksuid - 1sec resolution
	Id string `json:"id" validate:"required"`

	// properties
	Timestamps int64  `json:"timestamps"`
	Data       string `json:"data"`
}

func (*Event) Key

func (event *Event) Key() string

func (*Event) Valid

func (event *Event) Valid() bool

func (*Event) WithBucket

func (event *Event) WithBucket(template string) error

func (*Event) WithId

func (event *Event) WithId() error

Jump to

Keyboard shortcuts

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