metadata

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetaData

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

func New

func New(options ...Option) MetaData

func (MetaData) Format

func (m MetaData) Format() types.DataFormat

func (MetaData) LogValue

func (m MetaData) LogValue() slog.Value

func (MetaData) SchemaHint

func (m MetaData) SchemaHint() string

func (MetaData) Seq

func (m MetaData) Seq() int

func (MetaData) Slug

func (m MetaData) Slug() string

func (MetaData) Timestamp

func (m MetaData) Timestamp() time.Time

type Option

type Option func(*MetaData)

func WithFormat

func WithFormat(f types.DataFormat) Option

func WithSchemaHint

func WithSchemaHint(hint string) Option

func WithSeq

func WithSeq(seq int) Option

WithSeq sets sequence number to MetaData. It's used to identify the order of data.

func WithSlug

func WithSlug(slug string) Option

func WithTimestamp

func WithTimestamp(ts time.Time) Option

WithTimestamp sets timestamp to MetaData. If it's not set, it uses the current time.

Jump to

Keyboard shortcuts

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