database

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database added in v0.3.0

type Database interface {
	InsertProduct(*Product) octobe.Handler
	UpdateProduct(*Product) octobe.Handler
	ProductByID(*Product) octobe.Handler
	Products(*[]Product) octobe.Handler
}

Database interface that implements the databases, with this you can mock Database.

type Handler added in v0.3.0

type Handler struct{}

Handler implements the database interface

func (Handler) InsertProduct added in v0.3.0

func (Handler) InsertProduct(p *Product) octobe.Handler

InsertProduct will take a pointer of a product, and insert it

func (Handler) ProductByID added in v0.3.0

func (Handler) ProductByID(id int64, p *Product) octobe.Handler

ProductByID will take an id, and a pointer to scan into

func (Handler) Products added in v0.3.0

func (Handler) Products(result *[]Product) octobe.Handler

Products will take a pointer to append Products into

func (Handler) UpdateProduct added in v0.3.0

func (Handler) UpdateProduct(p *Product) octobe.Handler

UpdateProduct will take a pointer and update the fields

type Product

type Product struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

Product is an example database model

Jump to

Keyboard shortcuts

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