web

package
v0.0.0-...-e029def Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
)
View Source
var (
	AuthorFirstNameInvalid = errors.New("author's first name is invalid")
	AuthorLastNameInvalid  = errors.New("author's last name is invalid")
)
View Source
var (
	MissingPermissions = errors.New("missing permissions")
)
View Source
var (
	TemplatesDir = pkger.Dir("/templates")
)

Functions

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)

Types

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"`
}

Jump to

Keyboard shortcuts

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