httptypes

package
v2.0.11+incompatible Latest Latest
Warning

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

Go to latest
Published: May 15, 2015 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPError

type HTTPError struct {
	Message string `json:"message"`
	// HTTP return code
	Code int `json:"-"`
}

func NewHTTPError

func NewHTTPError(code int, m string) *HTTPError

func (HTTPError) Error

func (e HTTPError) Error() string

func (HTTPError) WriteTo

func (e HTTPError) WriteTo(w http.ResponseWriter)

TODO(xiangli): handle http write errors

type Member

type Member struct {
	ID         string   `json:"id"`
	Name       string   `json:"name"`
	PeerURLs   []string `json:"peerURLs"`
	ClientURLs []string `json:"clientURLs"`
}

type MemberCollection

type MemberCollection []Member

func (*MemberCollection) MarshalJSON

func (c *MemberCollection) MarshalJSON() ([]byte, error)

func (*MemberCollection) UnmarshalJSON

func (c *MemberCollection) UnmarshalJSON(data []byte) error

type MemberCreateRequest

type MemberCreateRequest struct {
	PeerURLs types.URLs
}

func (*MemberCreateRequest) MarshalJSON

func (m *MemberCreateRequest) MarshalJSON() ([]byte, error)

func (*MemberCreateRequest) UnmarshalJSON

func (m *MemberCreateRequest) UnmarshalJSON(data []byte) error

type MemberUpdateRequest

type MemberUpdateRequest struct {
	MemberCreateRequest
}

Jump to

Keyboard shortcuts

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