records

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

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

Go to latest
Published: Mar 26, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create - Insert form

func CreateProcess

func CreateProcess(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

CreateProcess - Insert

func DeleteBook

func DeleteBook(r *http.Request) error

DeleteBook - Delete one record

func DeleteProcess

func DeleteProcess(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

DeleteProcess Delete record and return to items page

func Index

Index - Show all

func Show

Show - View one

func Update

Update form

func UpdateProcess

func UpdateProcess(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

UpdateProcess - Update

Types

type Book

type Book struct {
	// add ID and tags if you need them
	// ID     bson.ObjectId // `json:"id" bson:"_id"`
	Isbn   string  // `json:"isbn" bson:"isbn"`
	Title  string  // `json:"title" bson:"title"`
	Author string  // `json:"author" bson:"author"`
	Price  float32 // `json:"price" bson:"price"`
}

Book record fields

func AllBooks

func AllBooks() ([]Book, error)

AllBooks finds all records

func OneBook

func OneBook(r *http.Request) (Book, error)

OneBook finds one record

func PutBook

func PutBook(r *http.Request) (Book, error)

PutBook - Inserts

func UpdateBook

func UpdateBook(r *http.Request) (Book, error)

UpdateBook - Update one record

Jump to

Keyboard shortcuts

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