responsetemplate

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: 2 Imported by: 8

Documentation

Overview

Package responsetemplate provides basic functionality to handle API response data

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseTemplate

type ResponseTemplate struct {
	Raw  string
	Hash map[string]interface{}
}

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

func NewResponseTemplate

func NewResponseTemplate(raw string) *ResponseTemplate

NewResponseTemplate represents the constructor for struct ResponseTemplate.

func (*ResponseTemplate) GetCode

func (rt *ResponseTemplate) GetCode() int

GetCode method to return the API response code

func (*ResponseTemplate) GetDescription

func (rt *ResponseTemplate) GetDescription() string

GetDescription method to return the API response description

func (*ResponseTemplate) GetHash

func (rt *ResponseTemplate) GetHash() map[string]interface{}

GetHash method to return API response in hash format

func (*ResponseTemplate) GetPlain

func (rt *ResponseTemplate) GetPlain() string

GetPlain method to return raw API response

func (*ResponseTemplate) GetQueuetime

func (rt *ResponseTemplate) GetQueuetime() float64

GetQueuetime method to return API response queuetime

func (*ResponseTemplate) GetRuntime

func (rt *ResponseTemplate) GetRuntime() float64

GetRuntime method to return API response runtime

func (*ResponseTemplate) IsError

func (rt *ResponseTemplate) IsError() bool

IsError method to check if API response represents an error case

func (*ResponseTemplate) IsPending

func (rt *ResponseTemplate) IsPending() bool

IsPending method to check if current operation is returned as pending

func (*ResponseTemplate) IsSuccess

func (rt *ResponseTemplate) IsSuccess() bool

IsSuccess method to check if API response represents a success case

func (*ResponseTemplate) IsTmpError

func (rt *ResponseTemplate) IsTmpError() bool

IsTmpError method to check if current API response represents a temporary error case

Jump to

Keyboard shortcuts

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