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

client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package client provides a bounded, authenticated HTTP client for Questlock. Publish never automatically retries. To retry after an uncertain response, reuse the exact same request and operation ID so the server can replay it.

Index

Constants

View Source
const (
	DefaultTimeout   = 15 * time.Second
	MaxResponseBytes = 16 << 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client may be shared by concurrent goroutines. Its credentials are sent only to the configured server; redirects are rejected.

func New

func New(baseURL, token string) (*Client, error)

New creates a client with a 15-second request timeout and 16MiB response limit. Plain HTTP is accepted only for literal loopback IP addresses. All other hosts require HTTPS. Environment proxy settings are deliberately ignored.

func (*Client) Audit

func (c *Client) Audit(ctx context.Context, limit int) ([]protocol.AuditEvent, error)

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string) (protocol.Artifact, error)

func (*Client) List

func (c *Client) List(ctx context.Context) ([]protocol.Artifact, error)

func (*Client) Publish

type Error

type Error struct {
	Code           string
	Message        string
	CurrentVersion int64
	Status         int
}

Error is an error returned by the service, with its HTTP status preserved.

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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