params

package
v0.0.0-...-73d830b Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNetwork = "tcp"
	DefaultAddress = "localhost:46753"
)

Variables

This section is empty.

Functions

func NewError

func NewError(code ErrorCode, f string, a ...interface{}) error

NewError returns a new *Error with the given error code and message.

Types

type AccessRequest

type AccessRequest struct {
	httprequest.Route `httprequest:"POST /macaroon"`
	Password          string `httprequest:"password,form"`
}

type AccessResponse

type AccessResponse struct {
	Macaroon *bakery.Macaroon `json:"macaroon"`
}

type Error

type Error struct {
	Message string    `json:"message,omitempty"`
	Code    ErrorCode `json:"code,omitempty"`
}

Error represents an error - it is returned for any response that fails.

func (*Error) Cause

func (e *Error) Cause() error

Cause implements errgo.Causer.Cause.

func (*Error) Error

func (e *Error) Error() string

Error implements error.Error.

func (*Error) ErrorCode

func (e *Error) ErrorCode() string

ErrorCode holds the class of the error in machine readable format.

type ErrorCode

type ErrorCode string

ErrorCode holds the class of an error in machine-readable format. It is also an error in its own right.

const (
	ErrNotFound              ErrorCode = "not found"
	ErrInitialPasswordNeeded ErrorCode = "initial password needed"
	ErrBadRequest            ErrorCode = "bad request"
	ErrUnauthorized          ErrorCode = "unauthorized"
)

func (ErrorCode) Error

func (code ErrorCode) Error() string

func (ErrorCode) ErrorCode

func (code ErrorCode) ErrorCode() ErrorCode

type FindRootKeyRequest

type FindRootKeyRequest struct {
	httprequest.Route `httprequest:"GET /key/:Id"`
	Id                string `httprequest:",path"`
}

type FindRootKeyResponse

type FindRootKeyResponse struct {
	RootKey []byte `json:"rootKey"`
}

type NewRootKeyRequest

type NewRootKeyRequest struct {
	httprequest.Route `httprequest:"POST /key"`
}

type NewRootKeyResponse

type NewRootKeyResponse struct {
	Id      []byte `json:"id"`
	RootKey []byte `json:"rootKey"`
}

type SetPasswordRequest

type SetPasswordRequest struct {
	httprequest.Route `httprequest:"PUT /password"`
	OldPassword       string `httprequest:"oldPassword,form"`
	NewPassword       string `httprequest:"newPassword,form"`
}

Jump to

Keyboard shortcuts

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