resource

package
v0.0.0-...-d400468 Latest Latest
Warning

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

Go to latest
Published: May 21, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NounResource

type NounResource struct {
	NounStorage storage.NounStorage
}

NounResource for api2go routes

func (NounResource) Create

func (s NounResource) Create(obj interface{}, r api2go.Request) (api2go.Responder, error)

Create method to satisfy `api2go.DataSource` interface

func (NounResource) Delete

func (s NounResource) Delete(id string, r api2go.Request) (api2go.Responder, error)

Delete to satisfy `api2go.DataSource` interface

func (NounResource) FindAll

func (s NounResource) FindAll(r api2go.Request) (api2go.Responder, error)

FindAll to satisfy api2go data source interface

func (NounResource) FindOne

func (s NounResource) FindOne(ID string, r api2go.Request) (api2go.Responder, error)

FindOne to satisfy `api2go.DataSource` interface this method should return the noun with the given ID, otherwise an error

func (NounResource) PaginatedFindAll

func (s NounResource) PaginatedFindAll(r api2go.Request) (uint, api2go.Responder, error)

PaginatedFindAll can be used to load nouns in chunks

func (NounResource) Update

func (s NounResource) Update(obj interface{}, r api2go.Request) (api2go.Responder, error)

Update stores all changes on the noun

type Response

type Response struct {
	Res  interface{}
	Code int
}

The Response struct implements api2go.Responder

func (Response) Metadata

func (r Response) Metadata() map[string]interface{}

Metadata returns additional meta data

func (Response) Result

func (r Response) Result() interface{}

Result returns the actual payload

func (Response) StatusCode

func (r Response) StatusCode() int

StatusCode sets the return status code

type TensePresIndResource

type TensePresIndResource struct {
	TensePresIndStorage storage.TensePresIndStorage
}

TensePresIndResource for api2go routes

func (TensePresIndResource) Create

func (s TensePresIndResource) Create(obj interface{}, r api2go.Request) (api2go.Responder, error)

Create method to satisfy `api2go.DataSource` interface

func (TensePresIndResource) Delete

Delete to satisfy `api2go.DataSource` interface

func (TensePresIndResource) FindAll

FindAll to satisfy api2go data source interface

func (TensePresIndResource) FindOne

FindOne to satisfy `api2go.DataSource` interface this method should return the tense with the given ID, otherwise an error

func (TensePresIndResource) PaginatedFindAll

func (s TensePresIndResource) PaginatedFindAll(r api2go.Request) (uint, api2go.Responder, error)

PaginatedFindAll

func (TensePresIndResource) Update

func (s TensePresIndResource) Update(obj interface{}, r api2go.Request) (api2go.Responder, error)

Update stores all changes on the tense

type VerbResource

type VerbResource struct {
	VerbStorage storage.VerbStorage
}

VerbResource for api2go routes

func (VerbResource) Create

func (s VerbResource) Create(obj interface{}, r api2go.Request) (api2go.Responder, error)

Create method to satisfy `api2go.DataSource` interface

func (VerbResource) Delete

func (s VerbResource) Delete(id string, r api2go.Request) (api2go.Responder, error)

Delete to satisfy `api2go.DataSource` interface

func (VerbResource) FindAll

func (s VerbResource) FindAll(r api2go.Request) (api2go.Responder, error)

FindAll to satisfy api2go data source interface

func (VerbResource) FindOne

func (s VerbResource) FindOne(ID string, r api2go.Request) (api2go.Responder, error)

FindOne to satisfy `api2go.DataSource` interface this method should return the verb with the given ID, otherwise an error

func (VerbResource) PaginatedFindAll

func (s VerbResource) PaginatedFindAll(r api2go.Request) (uint, api2go.Responder, error)

PaginatedFindAll

func (VerbResource) Update

func (s VerbResource) Update(obj interface{}, r api2go.Request) (api2go.Responder, error)

Update stores all changes on the verb

Jump to

Keyboard shortcuts

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