router

package
v0.0.0-...-6c7e677 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableHandlers

func EnableHandlers(p *EndPoint)

EnableHandlers -

func Setup

func Setup() *gin.Engine

Setup -

Types

type Context

type Context struct {
	Params    map[string]interface{}
	ExtraBody interface{}
	Body      []byte
	Headers   interface{}
	Queries   map[string]interface{}
}

Context -

type EndPoint

type EndPoint struct {
	Name    string
	Method  string
	Handler func(ctx *gin.Context) (int, *Response)
	Group   *gin.RouterGroup
}

EndPoint -

type Environments

type Environments struct {
	Port string
}

Environments -

type Response

type Response struct {
	Status  string      `json:"status,omitempty"` // OK, Error, Warning
	Data    interface{} `json:"data,omitempty"`
	Error   string      `json:"error,omitempty"`
	Message string      `json:"message,omitempty"`
}

Response -

func NewResponseSuccess

func NewResponseSuccess(data interface{}) *Response

NewResponseSuccess -

func NewResponseSuccessWithMessage

func NewResponseSuccessWithMessage(data interface{}, msg string) *Response

NewResponseSuccessWithMessage -

func NewResposeError

func NewResposeError(err string, errCode string) *Response

NewResposeError -

Jump to

Keyboard shortcuts

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