api

package
v0.0.0-...-10febd9 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2017 License: Apache-2.0, Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServeMux

func NewServeMux(reg registry.Registry, tokenLimit int) http.Handler

func ValidateName

func ValidateName(name string) error

ValidateName ensures that a given unit name is valid; if not, an error is returned describing the first issue encountered. systemd reference: `unit_name_is_valid` in `unit-name.c`

func ValidateOptions

func ValidateOptions(opts []*schema.UnitOption) error

ValidateOptions ensures that a set of UnitOptions is valid; if not, an error is returned detailing the issue encountered. If there are several problems with a set of options, only the first is returned.

Types

type PageToken

type PageToken struct {
	Limit uint16
	Page  uint16
}

func DefaultPageToken

func DefaultPageToken(limit uint16) PageToken

func (PageToken) Encode

func (tok PageToken) Encode() string

func (PageToken) Next

func (tok PageToken) Next() PageToken

type Server

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

func NewServer

func NewServer(listeners []net.Listener, hdlr http.Handler) *Server

func (*Server) Available

func (s *Server) Available(stop <-chan struct{})

Available switches the Server's HTTP handler from a generic 503 Unavailable response to the actual API. Once the provided channel is closed, the API is torn back down and 503 responses are served.

func (*Server) GetListeners

func (s *Server) GetListeners() []net.Listener

func (*Server) Serve

func (s *Server) Serve()

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(rw http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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