Back to godoc.org

Package web

v0.0.0-...-e029def
Latest Go to latest

The latest major version is .

Published: Mar 23, 2020 | License: MIT | Module: github.com/A1Liu/webserver

Index

Variables

var (
	MissingLogin       = errors.New("missing login query parameter")
	MissingPassword    = errors.New("missing password query parameter")
	NoLoginInformation = errors.New("neither login nor password was provided")
	MissingToken       = errors.New("missing token")
	TooManyAuthMethods = errors.New("gave too many authorization methods")
)
var (
	AuthorFirstNameInvalid = errors.New("author's first name is invalid")
	AuthorLastNameInvalid  = errors.New("author's last name is invalid")
)
var (
	MissingPermissions = errors.New("missing permissions")
)
var (
	TemplatesDir = pkger.Dir("/templates")
)

func AddAuthorsApi

func AddAuthorsApi(authors *gin.RouterGroup)

func AddBooksApi

func AddBooksApi(books *gin.RouterGroup)

func AddImagessApi

func AddImagessApi(images *gin.RouterGroup)

func AddPermissionsApi

func AddPermissionsApi(permissions *gin.RouterGroup)

func AddUsersApi

func AddUsersApi(users *gin.RouterGroup)

func ExecuteTemplate

func ExecuteTemplate(name, path string, f func(c *gin.Context) interface{}) gin.HandlerFunc

func Index

func Index(c *gin.Context) interface{}

func JsonFail

func JsonFail(c *gin.Context, err error) bool

func JsonInfer

func JsonInfer(c *gin.Context, object interface{}, err error)

func QueryParamLogin

func QueryParamLogin(c *gin.Context) (*models.User, error)

func QueryParamToken

func QueryParamToken(c *gin.Context) (*models.User, error)

func QueryParamUint

func QueryParamUint(c *gin.Context, param string) (*uint64, error)

type ErrorApiMessage

type ErrorApiMessage struct {
	Status  uint64 `json:"status"`
	Message string `json:"message"`
}

type IndexVars

type IndexVars struct{}

type OkApiMessage

type OkApiMessage struct {
	Status uint64      `json:"status"`
	Value  interface{} `json:"value"`
}

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier