meterevent

package
v1.0.0-beta.211 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaximumFromDuration     = time.Hour * 24 * 32 // 32 days
	MaximumLimit        int = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	// The event ID.
	ID string
	// The event type.
	Type string
	// The event source.
	Source string
	// The event subject.
	Subject string
	// The event time.
	Time time.Time
	// The event data as a JSON string.
	Data string
	// The time the event was ingested.
	IngestedAt time.Time
	// The time the event was stored.
	StoredAt time.Time
	// Validation errors.
	ValidationErrors []error
}

Event represents a single event.

func (Event) Cursor

func (e Event) Cursor() pagination.Cursor

Cursor returns the cursor for the event.

type ListEventsParams

type ListEventsParams struct {
	// The namespace.
	Namespace string
	// The client ID.
	ClientID *string
	// Start date-time. Inclusive.
	IngestedAtFrom *time.Time
	// End date-time. Inclusive.
	IngestedAtTo *time.Time
	// The event ID. Accepts partial ID.
	ID *string
	// The event subject. Accepts partial subject.
	Subject *string
	// Start date-time. Inclusive.
	From time.Time
	// End date-time. Inclusive.
	To *time.Time
	// Number of events to return.
	Limit int
}

ListEventsParams represents the input for ListEvents method.

func (ListEventsParams) Validate

func (i ListEventsParams) Validate() error

Validate validates the input.

type ListEventsV2Params

type ListEventsV2Params struct {
	// The namespace.
	Namespace string
	// The client ID.
	ClientID *string
	// The cursor.
	Cursor *pagination.Cursor
	// The limit.
	Limit *int
	// The ID filter.
	ID *filter.FilterString
	// The source filter.
	Source *filter.FilterString
	// The subject filter.
	Subject *filter.FilterString
	// The type filter.
	Type *filter.FilterString
	// The time filter.
	Time *filter.FilterTime
	// The ingested at filter.
	IngestedAt *filter.FilterTime
}

ListEventsV2Params is a parameter object for listing events.

func (ListEventsV2Params) Validate

func (p ListEventsV2Params) Validate() error

Validate validates the list events parameters.

type Service

type Service interface {
	ListEvents(ctx context.Context, params ListEventsParams) ([]Event, error)
	ListEventsV2(ctx context.Context, params ListEventsV2Params) (pagination.Result[Event], error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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