api

package
v0.0.0-...-04ba5ad Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecoderRequest

func DecoderRequest(req *http.Request, struzt interface{}) error

解析http.request中body参数到实体

func NewPrimary

func NewPrimary(swarmkitAPI api.ControlClient, tlsConfig *tls.Config, enableCors bool) *mux.Router

NewPrimary creates a new API router.

Types

type Durafmt

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

Durafmt holds the parsed duration and the original input duration.

func Parse

func Parse(dinput time.Duration) *Durafmt

Parse creates a new *Durafmt struct, returns error if input is invalid.

func ParseString

func ParseString(input string) (*Durafmt, error)

ParseString creates a new *Durafmt struct from a string, returns error if input is invalid.

func (*Durafmt) Duration

func (d *Durafmt) Duration() time.Duration

Duration return the Duration value

func (*Durafmt) String

func (d *Durafmt) String() string

String parses d *Durafmt into a human readable duration.

type Server

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

Server is a swarmkit API server.

func NewServer

func NewServer(host string, tlsConfig *tls.Config) *Server

NewServer creates an api.Server.

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() (err error)

ListenAndServe provide http rest api

func (*Server) SetHandler

func (s *Server) SetHandler(handler http.Handler)

SetHandler is used to overwrite the HTTP handler for the API. This can be the api router or a reverse proxy.

Jump to

Keyboard shortcuts

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