response

package
v3.5.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 9 Imported by: 8

Documentation

Overview

Package response provides extended functionality to handle API response data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	*rt.ResponseTemplate
	// contains filtered or unexported fields
}

Response is a struct used to cover basic functionality to work with API response data (or hardcoded API response data).

func NewResponse

func NewResponse(raw string, cmd map[string]string, ph ...map[string]string) *Response

NewResponse represents the constructor for struct Response.

func (*Response) AddColumn

func (r *Response) AddColumn(key string, data []string) *Response

AddColumn method to add a Column to the column list

func (*Response) AddRecord

func (r *Response) AddRecord(h map[string]string) *Response

AddRecord method to add a record to the record list

func (*Response) GetColumn

func (r *Response) GetColumn(key string) *column.Column

GetColumn method to get column by column name

func (*Response) GetColumnIndex

func (r *Response) GetColumnIndex(key string, index int) (string, error)

GetColumnIndex method to get data by column name and index

func (*Response) GetColumnKeys

func (r *Response) GetColumnKeys() []string

GetColumnKeys method to get the list of column names

func (*Response) GetColumns

func (r *Response) GetColumns() []column.Column

GetColumns method to get the list of columns

func (*Response) GetCommand

func (r *Response) GetCommand() map[string]string

GetCommand method to get the underlying API command

func (*Response) GetCommandPlain

func (r *Response) GetCommandPlain() string

GetCommandPlain method to get the underlying API command in plain text

func (*Response) GetCurrentPageNumber

func (r *Response) GetCurrentPageNumber() (int, error)

GetCurrentPageNumber method to get the page number of current list query

func (*Response) GetCurrentRecord

func (r *Response) GetCurrentRecord() *record.Record

GetCurrentRecord method to get record of current record index

func (*Response) GetFirstRecordIndex

func (r *Response) GetFirstRecordIndex() (int, error)

GetFirstRecordIndex method to get index of first row

func (*Response) GetLastRecordIndex

func (r *Response) GetLastRecordIndex() (int, error)

GetLastRecordIndex method to get last record index of the current list query

func (*Response) GetListHash

func (r *Response) GetListHash() map[string]interface{}

GetListHash method to get Response as List Hash including useful meta data for tables

func (*Response) GetNextPageNumber

func (r *Response) GetNextPageNumber() (int, error)

GetNextPageNumber method to get Page Number of next list query

func (*Response) GetNextRecord

func (r *Response) GetNextRecord() *record.Record

GetNextRecord method to get next record in record list

func (*Response) GetNumberOfPages

func (r *Response) GetNumberOfPages() int

GetNumberOfPages method to get the number of pages available for this list query

func (*Response) GetPagination

func (r *Response) GetPagination() map[string]interface{}

GetPagination method to get pagination data; useful for table pagination

func (*Response) GetPreviousPageNumber

func (r *Response) GetPreviousPageNumber() (int, error)

GetPreviousPageNumber method to get Page Number of previous list query

func (*Response) GetPreviousRecord

func (r *Response) GetPreviousRecord() *record.Record

GetPreviousRecord method to get previous record in record list

func (*Response) GetRecord

func (r *Response) GetRecord(idx int) *record.Record

GetRecord method to get Record at given index

func (*Response) GetRecords

func (r *Response) GetRecords() []record.Record

GetRecords method to get all records

func (*Response) GetRecordsCount

func (r *Response) GetRecordsCount() int

GetRecordsCount method to get count of rows in this response

func (*Response) GetRecordsLimitation

func (r *Response) GetRecordsLimitation() int

GetRecordsLimitation method to get limit(ation) setting of the current list query

func (*Response) GetRecordsTotalCount

func (r *Response) GetRecordsTotalCount() int

GetRecordsTotalCount method to get total count of records available for the list query

func (*Response) HasNextPage

func (r *Response) HasNextPage() bool

HasNextPage method to check if this list query has a next page

func (*Response) HasPreviousPage

func (r *Response) HasPreviousPage() bool

HasPreviousPage method to check if this list query has a previous page

func (*Response) RewindRecordList

func (r *Response) RewindRecordList() *Response

RewindRecordList method to reset index in record list back to zero

Jump to

Keyboard shortcuts

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