streaming

package
v1.0.0-beta.189 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	namespace.Handler

	CountEvents(ctx context.Context, namespace string, params CountEventsParams) ([]CountEventRow, error)
	ListEvents(ctx context.Context, namespace string, params ListEventsParams) ([]api.IngestedEvent, error)
	CreateMeter(ctx context.Context, namespace string, meter models.Meter) error
	DeleteMeter(ctx context.Context, namespace string, meter models.Meter) error
	QueryMeter(ctx context.Context, namespace string, meter models.Meter, params QueryParams) ([]models.MeterQueryRow, error)
	ListMeterSubjects(ctx context.Context, namespace string, meter models.Meter, params ListMeterSubjectsParams) ([]string, error)
	BatchInsert(ctx context.Context, events []RawEvent) error
}

type CountEventRow

type CountEventRow struct {
	Count   uint64
	Subject string
	IsError bool
}

CountEventRow represents a row in the count events response.

type CountEventsParams

type CountEventsParams struct {
	From time.Time
}

type ListEventsParams

type ListEventsParams struct {
	From           *time.Time
	To             *time.Time
	IngestedAtFrom *time.Time
	IngestedAtTo   *time.Time
	ID             *string
	Subject        *string
	HasError       *bool
	Limit          int
}

type ListMeterSubjectsParams

type ListMeterSubjectsParams struct {
	From *time.Time
	To   *time.Time
}

type QueryParams

type QueryParams struct {
	From           *time.Time
	To             *time.Time
	FilterSubject  []string
	FilterGroupBy  map[string][]string
	GroupBy        []string
	WindowSize     *models.WindowSize
	WindowTimeZone *time.Location
}

func (*QueryParams) Validate

func (p *QueryParams) Validate(meter models.Meter) error

Validate validates query params focusing on `from` and `to` being aligned with query and meter window sizes

type RawEvent

type RawEvent struct {
	Namespace       string
	ValidationError string
	ID              string
	Type            string
	Source          string
	Subject         string
	Time            time.Time
	Data            string
	IngestedAt      time.Time
	StoredAt        time.Time
}

RawEvent represents a single raw event

Directories

Path Synopsis
clickhouse

Jump to

Keyboard shortcuts

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