apiserver

package
v0.0.0-...-6337964 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2014 License: AGPL-3.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoginValidator

type LoginValidator func(params.Creds) error

LoginValidator functions are used to decide whether login requests are to be allowed. The validator is called before credentials are checked.

type Server

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

Server holds the server side of the API.

func NewServer

func NewServer(s *state.State, cfg ServerConfig) (*Server, error)

NewServer serves the given state by accepting requests on the given listener, using the given certificate and key (in PEM format) for authentication.

func (*Server) Addr

func (srv *Server) Addr() string

Addr returns the address that the server is listening on.

func (*Server) Dead

func (srv *Server) Dead() <-chan struct{}

Dead returns a channel that signals when the server has exited.

func (*Server) Kill

func (srv *Server) Kill()

Kill implements worker.Worker.Kill.

func (*Server) Stop

func (srv *Server) Stop() error

Stop stops the server and returns when all running requests have completed.

func (*Server) Wait

func (srv *Server) Wait() error

Wait implements worker.Worker.Wait.

type ServerConfig

type ServerConfig struct {
	Addr      string
	Cert      []byte
	Key       []byte
	DataDir   string
	LogDir    string
	Validator LoginValidator
}

ServerConfig holds parameters required to set up an API server.

Directories

Path Synopsis
The machine package implements the API interfaces used by the machine agent.
The machine package implements the API interfaces used by the machine agent.
The machiner package implements the API interface used by the machiner worker.
The machiner package implements the API interface used by the machiner worker.
The uniter package implements the API interface used by the uniter worker.
The uniter package implements the API interface used by the uniter worker.

Jump to

Keyboard shortcuts

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