api

package
v0.0.0-...-875e73f Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MIMEApplicationJSONAPI is the MIME type for JSONAPI.
	MIMEApplicationJSONAPI = "application/vnd.api+json"
)

Variables

View Source
var (
	// WebPassword is the web token used for api auth.
	WebPassword string
)

Functions

This section is empty.

Types

type API

type API struct {
	Mux http.Handler
	// contains filtered or unexported fields
}

API is the autoscale API.

func New

func New(ctx context.Context, repo autoscale.Repository, notify *autoscale.Notify) *API

New creates an instance of API.

type MockResource

type MockResource struct {
	mock.Mock
}

func (*MockResource) Create

func (_m *MockResource) Create(c context.Context, obj interface{}) (Response, error)

func (*MockResource) Delete

func (_m *MockResource) Delete(c context.Context, id string) (Response, error)

func (*MockResource) FindAll

func (_m *MockResource) FindAll(c context.Context) (Response, error)

func (*MockResource) FindOne

func (_m *MockResource) FindOne(c context.Context, id string) (Response, error)

func (*MockResource) Update

func (_m *MockResource) Update(c context.Context, obj interface{}) (Response, error)

type MockResponse

type MockResponse struct {
	mock.Mock
}

func (*MockResponse) Result

func (_m *MockResponse) Result() interface{}

func (*MockResponse) StatusCode

func (_m *MockResponse) StatusCode() int

type Resource

type Resource interface {
	FindOne(c context.Context, id string) (Response, error)
	Create(c context.Context, obj interface{}) (Response, error)
	Delete(c context.Context, id string) (Response, error)
	Update(c context.Context, obj interface{}) (Response, error)
	FindAll(c context.Context) (Response, error)
}

Resource is an autoscale resource.

type Response

type Response interface {
	Result() interface{}
	StatusCode() int
}

Response is a response from a call to an autoscale resource.

Jump to

Keyboard shortcuts

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