result

package
v0.0.0-...-82e7740 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2019 License: MIT Imports: 12 Imported by: 4

README

data-result GoDoc

data result library for Go

Installation

go get gopkg.in/goyy/goyy.v0/data/result

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetPriority

func SetPriority(value int)

SetPriority set the priority of the logger.

Types

type Client

type Client struct {
	Body       []byte
	Status     string
	StatusCode int
	Header     http.Header
	Cookies    []*http.Cookie
}

Client result.Client.

func (*Client) ParseEntities

func (me *Client) ParseEntities(out *Entities) error

ParseEntities result.Client.Body to result.Entities.

func (*Client) ParseEntity

func (me *Client) ParseEntity(out *Entity) error

ParseEntity result.Client.Body to result.Entity.

func (*Client) ParsePage

func (me *Client) ParsePage(out *Page) error

ParsePage result.Client.Body to result.Page.

func (*Client) ParseResult

func (me *Client) ParseResult(out *Result) error

ParseResult result.Client.Body to result.Result.

type Entities

type Entities struct {
	Success bool              `json:"success"`
	Token   string            `json:"token"`
	Code    int               `json:"code"`
	Message string            `json:"message"`
	Memo    string            `json:"memo"`
	Tag     string            `json:"tag"`
	Data    entity.Interfaces `json:"data"`
}

Entities result.Entities.

func (*Entities) JSON

func (me *Entities) JSON() string

Json result.Entities to Json.

func (*Entities) ParseJSON

func (me *Entities) ParseJSON(json string) error

ParseJSON Json to result.Entities.

type Entity

type Entity struct {
	Success bool             `json:"success"`
	Token   string           `json:"token"`
	Code    int              `json:"code"`
	Message string           `json:"message"`
	Memo    string           `json:"memo"`
	Tag     string           `json:"tag"`
	Data    entity.Interface `json:"data"`
}

Entity result.Entity.

func (*Entity) JSON

func (me *Entity) JSON() string

JSON result.Entity to Json.

func (*Entity) ParseJSON

func (me *Entity) ParseJSON(json string) error

ParseJSON Json to result.Entity.

type Http

type Http struct {
	Success bool              `json:"success"`
	Token   string            `json:"token"`
	Code    int               `json:"code"`    // view message code
	Message string            `json:"message"` // view message content
	State   string            `json:"state"`   // view display state
	Memo    string            `json:"memo"`
	Tag     string            `json:"tag"`
	Params  map[string]string `json:"params"`
	Data    interface{}       `json:"data"`
}

Http result.Http.

func (*Http) JSON

func (me *Http) JSON() (string, error)

JSON result.Http to JSON.

func (*Http) ParseJSON

func (me *Http) ParseJSON(jsons string) error

ParseJSON JSON to result.Http.

type Page

type Page struct {
	Success bool        `json:"success"`
	Id      string      `json:"id"`
	Token   string      `json:"token"`
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Memo    string      `json:"memo"`
	Tag     string      `json:"tag"`
	Data    domain.Page `json:"data"`
}

Page result.Page.

func (*Page) JSON

func (me *Page) JSON() string

Json result.Page to Json.

func (*Page) ParseJSON

func (me *Page) ParseJSON(json string) error

ParseJSON Json to result.Page.

type Pagination

type Pagination struct {
	PageNo        int         `json:"pageNo"`
	PageSize      int         `json:"pageSize"`
	PageFn        string      `json:"pageFn"`
	TotalElements int         `json:"totalElements"`
	Length        int         `json:"length"`
	Slider        int         `json:"slider"`
	Slice         interface{} `json:"slice"`
}

Pagination result.Pagination.

func (*Pagination) First

func (me *Pagination) First() int

First get the first page.

func (*Pagination) JSON

func (me *Pagination) JSON() (string, error)

JSON result.Pagination to JSON.

func (*Pagination) Last

func (me *Pagination) Last() int

Last get the last page.

func (*Pagination) Next

func (me *Pagination) Next() int

Next get the next page.

func (*Pagination) ParseJSON

func (me *Pagination) ParseJSON(jsons string) error

ParseJSON JSON to result.Pagination.

func (*Pagination) Previous

func (me *Pagination) Previous() int

Previous get the previous page.

type Result

type Result struct {
	Success bool        `json:"success"`
	Token   string      `json:"token"`
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Memo    string      `json:"memo"`
	Tag     string      `json:"tag"`
	Data    interface{} `json:"data"`
}

Result result.Result.

func (*Result) JSON

func (me *Result) JSON() (string, error)

JSON result.Result to JSON.

func (*Result) ParseJSON

func (me *Result) ParseJSON(jsons string) error

ParseJSON JSON to result.Result.

Jump to

Keyboard shortcuts

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