types

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToURLQuery

func ConvertToURLQuery(l ListingOptions) string

Types

type ListingMetas

type ListingMetas struct {
	// the total count of records for the current request
	NumOfRecordsForRequest uint32
	// the page size which was used must not be the same like the szize requested
	UsedPageSize uint32 `json:"used_page_size,omitempty"`
}

use this as response for lists with options

type ListingOptions

type ListingOptions struct {
	//Partial representation (comma separated list of field names), ?fields=
	Fields string `json:"fields,omitempty"`
	//The response message will be filtered by the fields before being sent back to the client, filter=[['id','eq','1']]
	Filter string `json:"filter,omitempty"`
	//Specifies the result ordering for List requests. The default sorting order is ascending, ?order_by=foo desc,bar
	OrderBy string `json:"order_by,omitempty"`
	//Use this field to specify the maximum number of results to be returned by the server.
	//  The server may further constrain the maximum number of results returned in a single page.
	//  If the page_size is 0, the server will decide the number of results to be returned. page_size=15
	PageSize uint32 `json:"page_size,omitempty"`
	// The page to display
	Page uint32 `json:"page,omitempty"`
	// The cursor to display a page
	// use this if you have a lot of new data while paginating...
	PageCursor string `json:"page_cursor,omitempty"`
	//Query term to search
	Q string `json:"q,omitempty"`
	//allows the client to specify which view of the resource it wants to receive in the response. view=menu
	View string `json:"view,omitempty"`
}

use this type for listings with options

Jump to

Keyboard shortcuts

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