meterevent

package
v1.0.0-beta.228 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 8 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 event customer ID.
	CustomerID *string
	// The time the event was ingested.
	IngestedAt time.Time
	// The time the event was stored.
	StoredAt time.Time
	// StoreRowID is the unique per-row identifier assigned at ingest time.
	// Used as the cursor tiebreak to avoid losing events that share the same
	// DateTime-second timestamp.
	StoreRowID string
	// SortBy is the sort column used to generate the cursor.
	SortBy streaming.EventSortField
	// 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. The cursor time is taken from the column referenced by SortBy so keyset pagination stays consistent with the underlying ORDER BY.

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
	// The event customer ID.
	CustomerIDs *[]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 customer ID filter.
	CustomerID *filter.FilterString
	// The type filter.
	Type *filter.FilterString
	// The time filter.
	Time *filter.FilterTime
	// The ingested at filter.
	IngestedAt *filter.FilterTime
	// The stored at filter.
	StoredAt *filter.FilterTime
	// The sort column; zero value defaults to "time".
	SortBy streaming.EventSortField
	// The sort direction; zero value defaults to DESC.
	SortOrder sortx.Order
}

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