rest

package module
v0.0.0-...-1cae92f Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Allowed string = "Allowed"
View Source
var NotAllowed string = "Not Allowed"
View Source
var WillNotCascade string = "Will not Cascade"

Functions

func CreateRecordView

func CreateRecordView(jsonRecord interface{}, construct interface{}) func(r render.Render, c martini.Context)

func DeleteRecordView

func DeleteRecordView(viewParams Params) func(r render.Render, db *gorm.DB, c martini.Context)

func FindRecordFromIDParameter

func FindRecordFromIDParameter(c martini.Context, out interface{}) bool

func GetRecordView

func GetRecordView(viewParams Params) func(r render.Render, db *gorm.DB, c martini.Context)

func KeyExists

func KeyExists(db *gorm.DB, model interface{}, id int64) bool

func ListRecordsView

func ListRecordsView(viewParams Params) func(p *pagination.Pagination, db *gorm.DB, c martini.Context)

func ModifyRecordFieldView

func ModifyRecordFieldView(viewParams Params) func(r render.Render, db *gorm.DB, req *http.Request, c martini.Context)

func RenderError

func RenderError(r render.Render, errorCode int, message string)

func RenderErrorNotAllowed

func RenderErrorNotAllowed(r render.Render)

func RenderResultOK

func RenderResultOK(r render.Render)

Types

type Params

type Params struct {
	Model   interface{} // model struct zero value, e.g., User{}
	Allowed interface{} // dep injected func returning one of the not allowed reasons strings
	ToJSON  interface{} // dep injected func returning map[string]interface{}
	Filter  interface{} // dep injected func returning db *gorm.DB modified
	Valid   interface{} // dep injected func returning one of the not allowed reasons strings
	Field   string
}

type StringValueForm

type StringValueForm struct {
	Value string `form:"value" binding:"required"`
}

Jump to

Keyboard shortcuts

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