responses

package
v0.0.0-...-bfe46a2 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MPL-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Meta

type Meta struct {
	Status  string                 `json:"status,omitempty"`
	Message string                 `json:"message,omitempty"`
	Context map[string]interface{} `json:"context,omitempty"`
}

Meta - generic api output metadata

type PaginationResponse

type PaginationResponse struct {
	Page    int         `json:"page,omitempty"`
	Items   int         `json:"items,omitempty"`
	MaxPage int         `json:"max_page,omitempty"`
	Ordered []string    `json:"order,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

PaginationResponse - a response structure wrapper for pagination

func (*PaginationResponse) Render

func (pr *PaginationResponse) Render(ctx context.Context, w http.ResponseWriter, status int) error

Render - render response response structure { page: 1, items: 50, max_page: 10, ordered: ["id", "..."], transactions: [...] }

Jump to

Keyboard shortcuts

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