apitypes

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2016 License: MIT Imports: 3 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 Environment

type Environment struct {
	ID      string                 `json:"id"`
	Version int                    `json:"version"`
	Body    *primitive.Environment `json:"body"`
}

Environment contains information for creating a new Env object

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 OrgInvite

type OrgInvite struct {
	ID      string               `json:"id"`
	Version int                  `json:"version"`
	Body    *primitive.OrgInvite `json:"body"`
}

OrgInvite contains information for sending an Org invite

type Profile

type Profile struct {
	ID   string `json:"id"`
	Body *struct {
		Name     string `json:"name"`
		Username string `json:"username"`
	} `json:"body"`
}

Profile contains the fields in the response for the profiles endpoint

type Service

type Service struct {
	ID      *identity.ID       `json:"id"`
	Version int                `json:"version"`
	Body    *primitive.Service `json:"body"`
}

Service contains information for creating a new Service object

type SessionStatus

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

SessionStatus contains details about the user's daemon session.

type Signup

type Signup struct {
	Name       string
	Username   string
	Email      string
	Passphrase string
	InviteCode string
}

Signup contains information required for registering an account

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