helpers

package
v0.0.0-...-39a5f01 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authentication

func Authentication(ctx iris.Context)

func GetPagination

func GetPagination(db *gorm.DB, model interface{}, conditions *npq.NamedParameterQuery, limit int, page int) (map[string]interface{}, error)

func IsJSON

func IsJSON(s string) bool

Check JSON type

func IsSuccessCode

func IsSuccessCode(c int) bool

Validation HTTP Status Code Retrun true or false

func NewResponse

func NewResponse(ctx iris.Context, code int, content interface{})

Simple json response Handler from kataras/ iris code of HTTP status code Message Body

Types

type Detail

type Detail struct {
	Error interface{} `json:"errors,omitempty"`
	Data  interface{} `json:"data,omitempty"`
}

type Filter

type Filter struct {
	Key   string
	Value string
}

type Messages

type Messages struct {
	Status  int  `json:"status"`
	Success bool `json:"success"`
	*Detail
}

Response struct for message json

Jump to

Keyboard shortcuts

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