httpapi

package
v0.0.0-...-4406380 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingStore = errors.New("store not specified in request")

Functions

This section is empty.

Types

type AsyncIndex

type AsyncIndex struct {
	SourceField    string
	IndexColumn    string
	IndexTableName string
	Fields         []string
}

type HTTPAPI

type HTTPAPI struct {
	Address  string
	Protocol string
	Site     string

	Stores map[string]*schemaless.DataStore
	// contains filtered or unexported fields
}

HTTPAPI encapsulates everything we need to run a webserver.

func New

func New(l *zap.Logger) (*HTTPAPI, error)

New requires a zap logger (see pkg/log, and/or go.uber.org/zap) and a suitable config object. It returns an HTTPAPI or nil and an error. Properly configured, the HTTPAPI should be ready to have Start() called.

func (*HTTPAPI) Start

func (hs *HTTPAPI) Start() error

Start attempts to run the HTTPAPI, optionally returning an error. If no error is returned, the HTTPAPI should be running.

func (*HTTPAPI) Stop

func (hs *HTTPAPI) Stop(ctx context.Context) error

Stop attempts to shut down a webserver. An error will be returned if the shutdown is unsuccessful or the timeout exceeded.

type Specification

type Specification struct {
	Address  string
	Protocol string
	Site     string

	ShardConfigFile string
}

Jump to

Keyboard shortcuts

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