server

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandlerMiddleware

func HandlerMiddleware(handleFunc interface{}) func(*gin.Context)

func Middleware

func Middleware(serverInstance interface{}) gin.HandlerFunc

Types

type Display

type Display struct {
	Filter map[string]interface{} `json:"filter"`
	Sorter Sorter                 `json:"sort"`
}

Display defines how the data is displayed

func (*Display) GetFilterBoolean

func (d *Display) GetFilterBoolean(filterKey string) (bool, error)

GetFilterBoolean give the filter keyword return the boolean value

func (*Display) GetFilterNum

func (d *Display) GetFilterNum(filterKey string) (interface{}, error)

GetFilterNum give the filter keyword return the numeric value

func (*Display) GetFilterString

func (d *Display) GetFilterString(filterKey string) (string, error)

GetFilterString give the filter keyword return the string value

type PaginationInfo

type PaginationInfo struct {
	Start   uint64
	Limit   uint64
	HasNext bool
}

type PaginationQuery

type PaginationQuery struct {
	Start uint64 `json:"start"`
	Limit uint64 `json:"limit"`
}

type Sorter

type Sorter struct {
	By    string `json:"by"`
	Order string `json:"order"`
}

Jump to

Keyboard shortcuts

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