Documentation
¶
Overview ¶
Package paste provides easy API access to Sourcehut file pasting.
Index ¶
Constants ¶
const BaseURL = "https://paste.sr.ht/api/"
BaseURL is the default public Sourcehut paste API URL. It is exported for convenience.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
type Blob struct { ID string `json:"sha"` Created time.Time `json:"created"` Contents string `json:"contents"` }
Blob contains data about an individual file in a paste.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client handles communication with the paste related methods of the Sourcehut API.
API docs: https://man.sr.ht/paste.sr.ht/api.md
type Iter ¶
type Iter struct {
*sourcehut.Iter
}
Iter is used for iterating over a collection of pastes.
type Option ¶
Option is used to configure an API client.
func Base ¶
Base returns an option that configures the public Sourcehut API URL.
If base does not have a trailing slash, one is added automatically. If unspecified, BaseURL is used.
func SrhtClient ¶
func SrhtClient(client sourcehut.Client) Option
SrhtClient returns an option that configures the client to use the provided sourcehut.Client for API requests. If unspecified, the default sourcehut.Client (with no options of its own) is used.