rest

package
v0.0.0-...-da3856f Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseBody

type ResponseBody struct {
	Result bool                                 `json:"result"`
	Data   interface{}                          `json:"data"`
	Meta   map[string]ResponseBodyMetaInterface `json:"meta"`
	Error  string                               `json:"error"`
}

func NewResponseBody

func NewResponseBody(data interface{}) *ResponseBody

func NewResponseBodyError

func NewResponseBodyError(error error) ResponseBody

func NewResponseBodyWithPagination

func NewResponseBodyWithPagination(data interface{}, total int64, count int) *ResponseBody

type ResponseBodyInterface

type ResponseBodyInterface interface {
	IsSuccess() bool
	IsFailed() bool
}

type ResponseBodyMetaInterface

type ResponseBodyMetaInterface interface {
	GetMetaType() string
}

type ResponseBodyMetaPagination

type ResponseBodyMetaPagination struct {
	Total int64 `json:"total"`
	Count int64 `json:"count"`
}

func (*ResponseBodyMetaPagination) GetMetaType

func (p *ResponseBodyMetaPagination) GetMetaType() string

Jump to

Keyboard shortcuts

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