api

package
v0.0.0-...-1fa5987 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const MaxMessageSize = 48 * 1024

Max length of log messages. Size chosen to fit within a UDP packet (max size 64k) and reserve space for Syslog event headers. The message itself always includes a newline terminator as well.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEventInput

type AddEventInput struct {
	Stream    string            `json:"stream"`
	Timestamp string            `json:"timestamp"`
	Message   string            `json:"message"`
	Tags      map[string]string `json:"tags"`
}

type AddEventOutput

type AddEventOutput struct {
}

type ClearEventsInput

type ClearEventsInput struct {
	Streams []string `json:"streams"`
}

type ClearEventsOutput

type ClearEventsOutput struct {
}

type DescribeStreamsInput

type DescribeStreamsInput struct {
	Names []string `json:"names"`
}

type DescribeStreamsOutput

type DescribeStreamsOutput struct {
	Streams []StreamDescription `json:"streams"`
}

type Event

type Event struct {
	ID        string            `json:"id"`
	Stream    string            `json:"stream"`
	Timestamp string            `json:"timestamp"`
	Message   string            `json:"message"`
	Tags      map[string]string `json:"tags"`
}

type GetEventsInput

type GetEventsInput struct {
	Streams   []string `json:"streams"`
	Cursor    *string  `json:"cursor"`
	FilterStr string   `json:"filterStr"`
	Prev      *int     `json:"prev"`
	Next      *int     `json:"next"`
}

type GetEventsOutput

type GetEventsOutput struct {
	Items      []Event `json:"items"`
	PrevCursor string  `json:"prevCursor"`
	NextCursor string  `json:"nextCursor"`
}

type RemoveOldEventsInput

type RemoveOldEventsInput struct {
}

type RemoveOldEventsOutput

type RemoveOldEventsOutput struct {
}

type Store

type Store interface {
	ClearEvents(context.Context, *ClearEventsInput) (*ClearEventsOutput, error)
	DescribeStreams(context.Context, *DescribeStreamsInput) (*DescribeStreamsOutput, error)
	AddEvent(context.Context, *AddEventInput) (*AddEventOutput, error)
	// Returns pages of events for some set of streams. If `cursor` is specified, standard pagination behavior is used. Otherwise the cursor is assumed to represent the current tail of the stream.
	GetEvents(context.Context, *GetEventsInput) (*GetEventsOutput, error)
	RemoveOldEvents(context.Context, *RemoveOldEventsInput) (*RemoveOldEventsOutput, error)
}

Database of events organized into streams.

type StreamDescription

type StreamDescription struct {
	Name        string  `json:"name"`
	LastEventAt *string `json:"lastEventAt"`
}

Jump to

Keyboard shortcuts

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