api

package
v0.0.0-...-1005c5c Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const BufferSize = 50

Variables

This section is empty.

Functions

func NoFilter

func NoFilter(e model.Event) bool

Types

type API

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

func New

func New(s Store, b *Broadcaster, statsTTL time.Duration) (*API, error)

func (*API) ServeHTTP

func (a *API) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Broadcaster

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

func NewBroadcaster

func NewBroadcaster(s Store, retryTimeout time.Duration) *Broadcaster

func (*Broadcaster) Run

func (b *Broadcaster) Run() error

func (*Broadcaster) Stop

func (b *Broadcaster) Stop() error

func (*Broadcaster) Subscribe

func (b *Broadcaster) Subscribe(f Filter, prefill bool) (data <-chan []byte, unsubscribe func())

type Filter

type Filter func(model.Event) bool

func SearchFilter

func SearchFilter(f string, since time.Time) Filter

type Server

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

func NewServer

func NewServer(addr string, s Store, b *Broadcaster, statsTTL time.Duration) (*Server, error)

func (*Server) Run

func (s *Server) Run() error

func (*Server) Stop

func (s *Server) Stop() error

type Store

type Store interface {
	Search(filter string) ([]model.Event, error)
	Stats() (model.Stats, error)
	Events() <-chan model.Event
}

Directories

Path Synopsis
templ: version: v0.2.598
templ: version: v0.2.598

Jump to

Keyboard shortcuts

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