infra

package
v0.0.0-...-f295117 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBHandler

type DBHandler struct {
	DB *gorm.DB
}

func NewDBHandler

func NewDBHandler() *DBHandler

func (*DBHandler) Create

func (h *DBHandler) Create(value interface{}) (err error)

func (*DBHandler) Find

func (h *DBHandler) Find(dest interface{}, conds ...interface{}) (err error)

type HttpContext

type HttpContext struct {
	Writer  http.ResponseWriter
	Request *http.Request
}

func NewHttpContext

func NewHttpContext(w http.ResponseWriter, r *http.Request) *HttpContext

func (*HttpContext) Bind

func (c *HttpContext) Bind(i interface{}) (err error)

func (*HttpContext) JSON

func (c *HttpContext) JSON(code int, i interface{}) (err error)

type Router

type Router struct {
	Engine *mux.Router
}

func NewRouter

func NewRouter(c *di.Container) *Router

func (*Router) Start

func (r *Router) Start(port string) error

Jump to

Keyboard shortcuts

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