Help us shape the future of Go! Take the 2026 Go Developer Survey

godict

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2020 License: BSD-2-Clause Imports: 6 Imported by: 1

README

godict

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Marshal added in v1.0.4

func Marshal(val interface{}) (data []byte, e goerr.IError)

func ParseBody added in v1.0.3

func ParseBody(r io.ReadCloser, data interface{}) goerr.IError

func Send added in v1.0.3

func Send(writer http.ResponseWriter, response *Response)

func SendError added in v1.0.3

func SendError(writer http.ResponseWriter, e goerr.IError)

func SendJSON added in v1.0.5

func SendJSON(writer http.ResponseWriter, httpCode int, data interface{})

func SendOk added in v1.0.3

func SendOk(writer http.ResponseWriter, message interface{}, data interface{},
	pagination interface{})

func Unmarshal added in v1.0.4

func Unmarshal(data []byte, val interface{}) (e goerr.IError)

func YamlMarshal added in v1.0.4

func YamlMarshal(val interface{}) (data []byte, e goerr.IError)

func YamlUnmarshal added in v1.0.4

func YamlUnmarshal(data []byte, val interface{}) (e goerr.IError)

Types

type Dictionary

type Dictionary map[string]map[int]string

func (*Dictionary) DictionaryIdsInterface

func (d *Dictionary) DictionaryIdsInterface(dictionaryName string) (res []interface{}, e goerr.IError)

func (*Dictionary) DictionaryRender

func (d *Dictionary) DictionaryRender(dictionaryName string,
	dictionaryID int) (res DictionaryRender, e goerr.IError)

func (*Dictionary) IsKeyExists

func (d *Dictionary) IsKeyExists(key string) (res bool)

type DictionaryRender

type DictionaryRender struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type Pagination added in v1.0.3

type Pagination struct {
	Page  int `json:"page,omitempty"`
	Limit int `json:"limit,omitempty"`
	Total int `json:"total,omitempty"`
}

type Response added in v1.0.3

type Response struct {
	HTTPCode   int         `json:"-"`
	Message    interface{} `json:"message,omitempty"`
	Data       interface{} `json:"data,omitempty"`
	Pagination interface{} `json:"pagination,omitempty"`
	Error      interface{} `json:"error,omitempty"`
}

func Error added in v1.0.3

func Error(e goerr.IError) *Response

func Ok added in v1.0.3

func Ok(message interface{}, data interface{}, pagination interface{}) *Response

Jump to

Keyboard shortcuts

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