config

package
v0.0.0-...-1bc3864 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ACCEPT_HEADER          string = "application/json, text/plain, */*"
	USER_AGENT_HEADER      string = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.4692.71 Safari/417.36"
	ACCEPT_ENCODING_HEADER string = "gzip, deflate, br, zstd"
	ACCEPT_LANGUAGE        string = "en-US,en;q=0.9,bn;q=0.8"
)

Variables

View Source
var NotFoundHandler gin.HandlerFunc = func(ctx *gin.Context) {
	HandleErr(ctx, NewHttpError(404))
}

Functions

func HandleErr

func HandleErr(ctx *gin.Context, err *HttpError)

func IsHttpError

func IsHttpError(err error) bool

func NewClient

func NewClient() *resty.Client

Types

type HttpError

type HttpError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func NewHttpError

func NewHttpError(status int, message ...string) *HttpError

func (*HttpError) Error

func (httpErr *HttpError) Error() string

Jump to

Keyboard shortcuts

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