client

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is a sential error for HTTP status code 404.

Functions

This section is empty.

Types

type Client

type Client struct {
	Host string
	// If the key is not nil, the client sends unauthenticated requests.
	Signer *token.SigningKey
	Client *http.Client
}

Client is a client for the links REST API.

func New

func New(host string, signer *token.SigningKey) *Client

New creates a client with a default HTTP client. If pkcs8 is nil, client requests will be unauthenticated.

func (*Client) Delete

func (c *Client) Delete(link string) error

func (*Client) Get

func (c *Client) Get(link string) (string, error)

func (*Client) List

func (c *Client) List() (map[string]string, error)

func (*Client) Put

func (c *Client) Put(link string, uri string) error

Jump to

Keyboard shortcuts

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