api

package
v0.0.0-...-b59ab19 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogMiddleware

func LogMiddleware(h http.Handler) http.Handler

Types

type AddQuery

type AddQuery struct {
	Price       float32  `schema:"price,required"`
	Subject     string   `schema:"subject,required"`
	Description string   `schema:"description,required"`
	Photo       []string `schema:"photo"`
}

type Api

type Api struct {
	Service
}

func New

func New(service Service) *Api

func (*Api) Add

func (a *Api) Add(w http.ResponseWriter, r *http.Request)

func (*Api) Get

func (a *Api) Get(w http.ResponseWriter, r *http.Request)

func (*Api) List

func (a *Api) List(w http.ResponseWriter, r *http.Request)

type GetQuery

type GetQuery struct {
	Id    []string `schema:"id,required"`
	Field css      `schema:"field"`
}

type ListQuery

type ListQuery struct {
	Limit  int `schema:"limit"`
	Offset int `schema:"offset"`
	Sort   css `schema:"sort"`
}

type Service

type Service interface {
	Read([]string, []string, int, int, []string) (interface{}, error)
	Create(float32, string, string, []string) (interface{}, error)
}

Jump to

Keyboard shortcuts

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