Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v1.0.246 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "dev"
	Commit  = "unknown"
	Project = "API Client"
)

Functions

func TransformUrl

func TransformUrl(urlString string) string

func UserAgent

func UserAgent() string

Types

type CLIUrls

type CLIUrls struct {
	API       string
	App       string
	Transport string
	Gravity   string
}

type Client

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

func New

func New(ctx context.Context, logger logger.Logger, baseURL, token string) *Client

func (*Client) Do

func (c *Client) Do(method, pathParam string, payload any, response any) error

type Error

type Error struct {
	URL      string
	Method   string
	Status   int
	Body     string
	TheError error
	TraceID  string
}

func NewError

func NewError(url, method string, status int, body string, err error, traceID string) *Error

func (*Error) Error

func (e *Error) Error() string

type Response

type Response struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Code    string `json:"code,omitempty"`
	Error   struct {
		Issues []struct {
			Code    string   `json:"code"`
			Message string   `json:"message"`
			Path    []string `json:"path"`
		} `json:"issues"`
	} `json:"error"`
}

Jump to

Keyboard shortcuts

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