voids

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package voids provides a client for the third-party Voids quote API. It is independent from the local renderer in the root makeitaquote package.

Index

Constants

View Source
const (
	DefaultBaseURL = "https://api.voids.top"
	HostedEndpoint = "/fakequote"
	DirectEndpoint = "/fakequotebeta"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Endpoint string
	Status   int
	Body     []byte
	Err      error
}

APIError contains a failed endpoint's status and bounded response body.

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Unwrap

func (e *APIError) Unwrap() []error

type Client

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

func NewClient

func NewClient(options Options) (*Client, error)

func (*Client) Direct

func (c *Client) Direct(ctx context.Context, quote Quote) ([]byte, error)

Direct renders through /fakequotebeta and returns the image bytes in one request.

func (*Client) HostedBytes

func (c *Client) HostedBytes(ctx context.Context, quote Quote) ([]byte, error)

HostedBytes creates a hosted image and then downloads it in a second request.

func (*Client) HostedURL

func (c *Client) HostedURL(ctx context.Context, quote Quote) (*url.URL, error)

HostedURL renders through /fakequote and returns the API-hosted image URL.

type Options

type Options struct {
	BaseURL             *url.URL
	HTTPClient          *http.Client
	Timeout             time.Duration
	Retries             *int
	RetryDelay          *time.Duration
	Headers             http.Header
	MaxResponseBytes    int64
	AllowPrivateNetwork bool
}

type Quote

type Quote struct {
	Text        string
	Avatar      *url.URL
	Username    string
	DisplayName string
	Color       bool
	Watermark   string
}

Quote is the wire-compatible input accepted by Voids. Unlike local rendering, the avatar must already be an HTTP(S) URL.

Jump to

Keyboard shortcuts

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