api

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2021 License: Apache-2.0 Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	JwtExpirationHoursDefault = 3
)

Variables

This section is empty.

Functions

func AddRouter added in v1.1.0

func AddRouter(config *apiConfig.HTTPConfig, db *gorm.DB) (*mux.Router, error)

func Index

func Index(w http.ResponseWriter, r *http.Request)

func Logger

func Logger(inner http.Handler, name string) http.Handler

func NewRouter

func NewRouter(config *config.HTTPConfig, db *gorm.DB) *mux.Router

Types

type Route

type Route struct {
	Name        string
	Method      string
	Pattern     string
	HandlerFunc http.HandlerFunc
}

type Routes

type Routes []Route

type Server added in v1.1.0

type Server struct {
	*http.Server
	DB     *gorm.DB
	Config *apiConfig.HTTPConfig
}

func NewServer added in v1.1.0

func NewServer(config *apiConfig.HTTPConfig, db *gorm.DB) (*Server, error)

func (*Server) Start added in v1.1.0

func (srv *Server) Start()

Start runs ListenAndServe on the http.Server with graceful shutdown.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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