evhttp

package
v0.1.0-beta22 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMux

func DefaultMux(r evdb.Scanner, w evdb.Store) http.Handler

DefaultMux creates an HTTP endpoint for a evdb.DB

func EncodeQuery

func EncodeQuery(values url.Values, q *evdb.Query) error

EncodeQuery sets URL query values for a Query

func EncodeTimeRange

func EncodeTimeRange(values url.Values, q evdb.TimeRange)

EncodeTimeRange sets URL query values for a TimeRange

func ExecHandler

func ExecHandler(scanner evdb.Scanner) http.HandlerFunc

ExecHandler returns an HTTP endpoint that executes evql queries

func InflateRequest

func InflateRequest(next http.Handler) http.HandlerFunc

InflateRequest middleware inflates request body

func MatchFieldsFromURL

func MatchFieldsFromURL(values url.Values) (m evdb.MatchFields, err error)

MatchFieldsFromURL parses MatchFields from URL query

func NewStoreHandler

func NewStoreHandler(s evdb.Storer) http.Handler

NewStoreHandler returns an HTTP endpoint for a Storer

func ParseTime

func ParseTime(v string) (time.Time, error)

ParseTime parses time in various formats

func QueryFromURL

func QueryFromURL(values url.Values) (q evdb.Query, err error)

QueryFromURL parses a Query from a URL query

func QueryHandler

func QueryHandler(scan evdb.Scanner) http.HandlerFunc

QueryHandler returns a handler that serves Query HTTP requests

func ScanURL

func ScanURL(baseURL string, q *evdb.Query) (string, error)

ScanURL sets URL query from a Query

func StoreHandler

func StoreHandler(store evdb.Store, prefix string) http.HandlerFunc

StoreHandler returns an HTTP handler for a Store

func TimeRangeFromURL

func TimeRangeFromURL(values url.Values) (t evdb.TimeRange, err error)

TimeRangeFromURL parses a TimeRange from URL query

func TimeRangeURL

func TimeRangeURL(rawURL string, t *evdb.TimeRange) (string, error)

TimeRangeURL sets URL query values for a TimeRange

Types

type Execer

type Execer struct {
	URL string
	HTTPClient
}

Execer runs queries over http

func (*Execer) Exec

func (ex *Execer) Exec(ctx context.Context, r evdb.TimeRange, q string) ([]evdb.Results, error)

Exec implements evql.Execet interface over HTTP

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient does HTTP requests

type Querier

type Querier struct {
	URL string
	HTTPClient
}

Querier runs scan queries over http

func (*Querier) Query

func (s *Querier) Query(ctx context.Context, q *evdb.Query) (evdb.Results, error)

Query implements Querier interface

type Store

type Store struct {
	HTTPClient
	BaseURL string
}

Store is implements Store over HTTP

func (*Store) Storer

func (s *Store) Storer(event string) (evdb.Storer, error)

Storer implements Store interface

type Storer

type Storer struct {
	HTTPClient
	URL string
}

Storer is a remote Storer over HTTP

func (*Storer) Store

func (c *Storer) Store(r *evdb.Snapshot) error

Store implements Storer interface

Jump to

Keyboard shortcuts

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