apitypes

package
v0.5.0-rc Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: MIT Imports: 1 Imported by: 35

Documentation

Overview

Package apitypes defines types shared between the daemon and its api client.

Index

Constants

View Source
const (
	BadRequestError     = "bad_request"
	UnauthorizedError   = "unauthorized"
	NotFoundError       = "not_found"
	InternalServerError = "internal_server"
	NotImplementedError = "not_implemented"
)

These are the possible error types.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	StatusCode int

	Type string   `json:"type"`
	Err  []string `json:"error"`
}

Error represents standard formatted API errors from the daemon or registry.

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface for formatted API errors.

type ErrorType

type ErrorType string

ErrorType represents the string error types that the daemon and registry can return.

type Login

type Login struct {
	Email      string `json:"email"`
	Passphrase string `json:"passphrase"`
}

Login contains the required details for logging in to the api and daemon.

type SessionStatus

type SessionStatus struct {
	Token      bool `json:"token"`
	Passphrase bool `json:"passphrase"`
}

SessionStatus contains details about the user's daemon session.

type Version

type Version struct {
	Version string `json:"version"`
}

Version contains the release version of the daemon.

Jump to

Keyboard shortcuts

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