Documentation
¶
Overview ¶
Package bitbucket reads tags, files and directory listings of Bitbucket Cloud repositories through its REST API, with the same methods the GitHub client offers the digester.
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) Authenticated() bool
- func (c *Client) File(ctx context.Context, repo, ref, path string) ([]byte, error)
- func (c *Client) ReleaseBodies(context.Context, string, []string) (map[string]github.Release, error)
- func (c *Client) Releases(ctx context.Context, repo string) ([]github.Release, error)
- func (c *Client) RootFiles(ctx context.Context, repo string) ([]github.File, error)
- func (c *Client) TagRefs(ctx context.Context, repo string) ([]version.Ref, error)
- func (c *Client) Tags(ctx context.Context, repo string) ([]string, error)
- type Options
Constants ¶
const APIHost = "api.bitbucket.org"
APIHost is the host of the Bitbucket Cloud REST API.
const TokenEnv = "BITBUCKET_API_TOKEN"
TokenEnv is the environment variable whose token the client sends as Bearer.
Variables ¶
var ErrBadRepo = errors.New("not a bitbucket workspace/repo")
ErrBadRepo is wrapped by errors for a repository that isn't workspace/repo.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads tags and files of Bitbucket Cloud repositories. Bitbucket Cloud has no releases.
func New ¶
New returns a client that sends requests through hc. The token goes only to the API host.
func (*Client) Authenticated ¶
Authenticated reports whether the client has a token.
func (*Client) File ¶
File returns path in repo at ref; an empty ref means the default branch. A ref with a slash is looked up as a tag, because the src endpoint can't take one.
func (*Client) ReleaseBodies ¶
func (c *Client) ReleaseBodies(context.Context, string, []string) (map[string]github.Release, error)
ReleaseBodies returns no releases: Bitbucket Cloud has none, so notes come from files.
func (*Client) Releases ¶
Releases lists the tags of repo as releases without bodies, because Bitbucket Cloud has none.