client

package
v0.0.0-...-eb4c3ac Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiError

type ApiError struct {
	Err                 error
	ServerErrorResponse *ServerError
}

func NewApiError

func NewApiError(err error) *ApiError

func (*ApiError) Error

func (it *ApiError) Error() error

func (*ApiError) IsServerError

func (it *ApiError) IsServerError() bool

func (*ApiError) String

func (it *ApiError) String() string

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func New

func New(config *evtconfig.Instance, logger *logrus.Logger) *Instance

func (*Instance) Get

func (it *Instance) Get(path string, response interface{}) *ApiError

func (*Instance) Post

func (it *Instance) Post(path string, body interface{}, response interface{}) *ApiError

type ServerError

type ServerError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Error   struct {
		Code    int    `json:"code"`
		Name    string `json:"name"`
		What    string `json:"what"`
		Details []struct {
			Message    string `json:"message"`
			File       string `json:"file"`
			LineNumber int    `json:"line_number"`
			Method     string `json:"method"`
		} `json:"details"`
	} `json:"error"`
}

Jump to

Keyboard shortcuts

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