http

package
v0.0.0-...-b9535b4 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient() *client

Types

type APIErrorHandler

type APIErrorHandler interface {
	HandleAPIError(res interface{}) error
}

type Client

type Client interface {
	Get(ctx context.Context, url string, data proto.Message) error
	Post(ctx context.Context, url string, body interface{}, data proto.Message) error
}

type Decoder

type Decoder interface {
	Decode(body io.ReadCloser, res interface{}) error
}

type Response

type Response struct {
	ResponseStatus
	ResponseData
}

Response API response struct

type ResponseData

type ResponseData struct {
	Data json.RawMessage `json:"data,omitempty"`
}

type ResponseMap

type ResponseMap map[string]interface{}

type ResponseStatus

type ResponseStatus struct {
	Success      bool   `json:"success"`
	ErrorMessage string `json:"error_msg,omitempty"`
}

type Unmarshaler

type Unmarshaler interface {
	Unmarshal(byte interface{}, data proto.Message) error
}

Jump to

Keyboard shortcuts

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