resource

package
v0.0.0-...-2d12c20 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChocolateResource

type ChocolateResource struct {
	ChocStorage *storage.ChocolateStorage
	UserStorage *storage.UserStorage
}

ChocolateResource for api2go routes

func (ChocolateResource) Create

func (c ChocolateResource) Create(obj interface{}, r api2go.Request) (string, error)

Create a new choc

func (ChocolateResource) Delete

func (c ChocolateResource) Delete(id string, r api2go.Request) error

Delete a choc :(

func (ChocolateResource) FindAll

func (c ChocolateResource) FindAll(r api2go.Request) (interface{}, error)

FindAll chocolates

func (ChocolateResource) FindOne

func (c ChocolateResource) FindOne(ID string, r api2go.Request) (interface{}, error)

FindOne choc

func (ChocolateResource) Update

func (c ChocolateResource) Update(obj interface{}, r api2go.Request) error

Update a choc

type UserResource

type UserResource struct {
	ChocStorage *storage.ChocolateStorage
	UserStorage *storage.UserStorage
}

UserResource for api2go routes

func (UserResource) Create

func (s UserResource) Create(obj interface{}, r api2go.Request) (string, error)

Create method to satisfy `api2go.DataSource` interface

func (UserResource) Delete

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

Delete to satisfy `api2go.DataSource` interface

func (UserResource) FindAll

func (s UserResource) FindAll(r api2go.Request) (interface{}, error)

FindAll to satisfy api2go data source interface

func (UserResource) FindOne

func (s UserResource) FindOne(ID string, r api2go.Request) (interface{}, error)

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

func (UserResource) PaginatedFindAll

func (s UserResource) PaginatedFindAll(r api2go.Request) (interface{}, uint, error)

PaginatedFindAll can be used to load users in chunks

func (UserResource) Update

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

Update stores all changes on the user

Jump to

Keyboard shortcuts

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