api

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2020 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WrappedHandleFunc added in v0.1.0

func WrappedHandleFunc(fun func(w http.ResponseWriter, r *http.Request)) func(http.ResponseWriter, *http.Request, httprouter.Params)

WrappedHandleFunc wraps the usual http handler function into a function as expected by httprouter

Types

type API

type API struct {
	Router *httprouter.Router
	// contains filtered or unexported fields
}

API represents the implementation of the HTTP api of sokar

func New

func New(port int, options ...Option) *API

New creates a new runnable api server

func (*API) Join

func (api *API) Join()

Join waits until the api server has been teared down

func (*API) Start added in v0.1.0

func (api *API) Start()

Start the api server for sokar

func (*API) Stop

func (api *API) Stop() error

Stop stops/ tears down the api server

func (*API) String added in v0.1.0

func (api *API) String() string

String returns the name of this component

type Option added in v0.0.10

type Option func(api *API)

Option represents an option for the api

func WithLogger added in v0.0.10

func WithLogger(logger zerolog.Logger) Option

WithLogger adds a configured Logger to the api

Jump to

Keyboard shortcuts

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