transporter

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Code    int               `json:"code"`
	Message string            `json:"message"`
	Reasons map[string]string `json:"reasons"`
}

type HttpTransporter added in v0.0.2

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

func (HttpTransporter) Execute added in v0.0.2

func (tp HttpTransporter) Execute(ctx context.Context, method, route string, payload interface{}) (resp *Response, err error)

func (HttpTransporter) ExecuteWithToken added in v0.0.2

func (tp HttpTransporter) ExecuteWithToken(ctx context.Context, method, route, token string, payload interface{}) (resp *Response, err error)

type IHttpTransporter

type IHttpTransporter interface {
	Execute(ctx context.Context, method, route string, payload interface{}) (resp *Response, err error)
	ExecuteWithToken(ctx context.Context, method, route, token string, payload interface{}) (resp *Response, err error)
}

func NewHTTPTransporter

func NewHTTPTransporter(client *http.Client, uid, url string) IHttpTransporter

type Response

type Response struct {
	RequestID string                 `json:"request_id"`
	Content   map[string]interface{} `json:"content,omitempty"`
	Status    int                    `json:"status"`
	Message   string                 `json:"message"`
	Error     *ErrorResponse         `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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