client

package
v0.0.0-...-43d63c8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MulticraftAPIClient

type MulticraftAPIClient struct {
	Client *resty.Client
	// contains filtered or unexported fields
}

MulticraftAPIClient holds the information, and underlying HTTP client to talk to a Multicraft API

func New

func New(url, user, apiKey string) *MulticraftAPIClient

New creates a new *MulticraftAPIClient, which uses the specified url, user, and apiKey

func (*MulticraftAPIClient) Do

func (mc *MulticraftAPIClient) Do(method string, params map[string]string) (
	*MulticraftResponse, error)

Do performs a requests against the API client, attaching the necessary data and credentials in the expected format

type MulticraftResponse

type MulticraftResponse struct {
	Success bool        `json:"success"`
	Errors  []string    `json:"errors"`
	Data    interface{} `json:"data"`
}

func (*MulticraftResponse) Error

func (mr *MulticraftResponse) Error() string

func (*MulticraftResponse) IsError

func (mr *MulticraftResponse) IsError() bool

Jump to

Keyboard shortcuts

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