httptypes - ActiveState ActiveGo 1.8

Package httptypes

import ""

Overview ▾

Package httptypes defines how etcd's HTTP API entities are serialized to and deserialized from JSON.

type HTTPError

type HTTPError struct {
    Message string `json:"message"`
    // Code is the HTTP status 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) error

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)

type MemberCreateRequest

type MemberCreateRequest struct {
    PeerURLs types.URLs

func (*MemberCreateRequest) UnmarshalJSON

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

type MemberUpdateRequest

type MemberUpdateRequest struct {