envelope

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope interface {
	GetStatusCode() int
	SetService(val int) Envelope
	SetEndpoint(val int) Envelope
	AddError(err Error) Envelope
}

Envelope identifies the interface of a response structured format.

func NewEnvelope

func NewEnvelope(statusCode int, data interface{}, report *ListReport) Envelope

NewEnvelope instantiates a new response data envelope structure

type Error

type Error interface {
	SetService(val int) Error
	SetEndpoint(val int) Error
	SetParam(param int) Error
	SetError(err int) Error
	SetMessage(msg string) Error
	GetCode() string
	GetMessage() string
}

Error defines the interface to manipulate an error structure that hold the information of an execution error and be assigned to the response status error list.

func NewError

func NewError(code int, msg string) Error

NewError instantiates a new error instance.

type ListReport

type ListReport struct {
	Search string `json:"search" xml:"search"`
	Start  uint   `json:"start" xml:"start"`
	Count  uint   `json:"count" xml:"count"`
	Total  uint   `json:"total" xml:"total"`
	Prev   string `json:"prev" xml:"prev"`
	Next   string `json:"next" xml:"next"`
}

ListReport defines the structure of a response list report containing all the request information, but also the total amount of filtering records and links for the previous and next pages

func NewListReport

func NewListReport(search string, start uint, count uint, total uint) *ListReport

NewListReport instantiates a new response list report by populating the prev and next link information regarding the given filtering information

type Status

type Status interface {
	AddError(err Error) Status
	SetService(val int) Status
	SetEndpoint(val int) Status
}

Status defines the interface to manipulate a response status information structure.

func NewStatus

func NewStatus() Status

NewStatus instantiates a new request result status structure.

Jump to

Keyboard shortcuts

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