Documentation
¶
Overview ¶
Package gitlab reads tags, releases, files and directory listings of projects on gitlab.com or a self-managed GitLab host 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) Host() string
- func (c *Client) ReleaseBodies(ctx context.Context, repo string, tags []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 ( HeaderPrivateToken = "PRIVATE-TOKEN" HeaderJobToken = "JOB-TOKEN" )
Token header names. A personal, project or group token goes in HeaderPrivateToken, a CI job token in HeaderJobToken.
Variables ¶
var ErrBadRepo = errors.New("not a gitlab project path")
ErrBadRepo is wrapped by errors for an empty project path.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client reads tags, releases and files of projects on one GitLab host.
func New ¶
New returns a client for o.Host that sends requests through hc. The token goes only to that host.
func (*Client) Authenticated ¶
Authenticated reports whether the client has a token.
func (*Client) ReleaseBodies ¶
func (c *Client) ReleaseBodies(ctx context.Context, repo string, tags []string) (map[string]github.Release, error)
ReleaseBodies returns the releases of repo for tags, keyed by tag. The release list is read once per client.
func (*Client) Releases ¶
Releases lists every release of repo with its notes. An upcoming release counts as a draft.
func (*Client) RootFiles ¶
RootFiles lists the top directory of repo on its default branch. The tree has no sizes, so each file has size -1.