util

package
v0.0.0-...-78fb4d6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const APIENDPOINT = "https://api-hml.cryptum.io"

Variables

This section is empty.

Functions

func AddCryptumRequestHeader

func AddCryptumRequestHeader(request *http.Request)

func GetHttpClient

func GetHttpClient() (client http.Client)

func LoadEnv

func LoadEnv()

Types

type APIRequestError

type APIRequestError interface {
	Error()
	LogError()
	LogErrorWithData()
}

type APIRequestErrorData

type APIRequestErrorData struct {
	Message       string
	RealMessage   string
	HttpErrorCode int
	Err           error
}

func NewAPIGetError

func NewAPIGetError(err error) (restError APIRequestErrorData)

func NewAPIGetErrorEmpty

func NewAPIGetErrorEmpty() (restError APIRequestErrorData)

func NewAPIGetPartnerError

func NewAPIGetPartnerError(err error, partner string) (restError APIRequestErrorData)

func NewAPIPostError

func NewAPIPostError(err error) (restError APIRequestErrorData)

func NewAPIPostMarshellingError

func NewAPIPostMarshellingError(err error) (restError APIRequestErrorData)

func (*APIRequestErrorData) Error

func (re *APIRequestErrorData) Error() string

func (*APIRequestErrorData) LogError

func (re *APIRequestErrorData) LogError()

func (*APIRequestErrorData) LogErrorWithAditionalMsg

func (re *APIRequestErrorData) LogErrorWithAditionalMsg(aditionalMsg string)

func (*APIRequestErrorData) LogErrorWithData

func (re *APIRequestErrorData) LogErrorWithData(data any)

func (*APIRequestErrorData) SetError

func (re *APIRequestErrorData) SetError(err error)

Jump to

Keyboard shortcuts

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