api

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	BaseURL string
	Client  *http.Client
	ErrorParserFunc
}

func (*APIClient) SendRequest

func (a *APIClient) SendRequest(ctx context.Context, r Request) error

SendRequest Відправляє запит до API

type ErrorParser

type ErrorParser interface {
	Error([]byte) error
}

ErrorParser это интерфейс для разбора тела ошибки

type ErrorParserFunc

type ErrorParserFunc func([]byte) error

ErrorParserFunc тип функции, который соответствует интерфейсу ErrorParser

func (ErrorParserFunc) Error

func (f ErrorParserFunc) Error(body []byte) error

Error реализация интерфейса Error для функций

type Request

type Request struct {
	Method   string
	Path     string
	Params   map[string]string
	Headers  map[string]string
	Body     any
	Response any
	Error    error
}

Request конфігурація запиту

Jump to

Keyboard shortcuts

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