create

package
v0.0.0-...-a0d0b40 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewThingCreateHandler

func NewThingCreateHandler(db *sqlx.DB) gin.HandlerFunc

NewThingCreateHandler will return a handler for Thing creates.

The handler assumes that a Thing will be PUT using JSON.

Types

type SQLThingCreator

type SQLThingCreator struct {
	// contains filtered or unexported fields
}

SQLThingCreator implements a SQL creator

func (*SQLThingCreator) Create

func (r *SQLThingCreator) Create(c types.Thing) (int64, error)

Create inserts a Thing record in to the database

type ThingCreator

type ThingCreator interface {
	Create(c types.Thing) (int64, error)
}

ThingCreator defines the interface for this creator

func NewSQLThingCreator

func NewSQLThingCreator(db *sqlx.DB) ThingCreator

NewSQLThingCreator returns a SQL based ThingCreator

Jump to

Keyboard shortcuts

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