Documentation
¶
Overview ¶
Package gitlab implements the onair.Forge seam against the GitLab REST API. It is the first Forge, not the architecture - GitHub is a later drop-in behind the same interface.
Index ¶
- Constants
- type Client
- func (c *Client) Behind(ctx context.Context, from, to string) (int, error)
- func (c *Client) CommitURL(sha string) string
- func (c *Client) Head(ctx context.Context, branch string) (onair.Ref, error)
- func (c *Client) Host() string
- func (c *Client) LatestGreen(ctx context.Context, branch string) (onair.Ref, error)
- func (c *Client) Recent(ctx context.Context, branch string, limit int) ([]onair.Ref, error)
- func (c *Client) RequestURL(id string) string
- func (c *Client) Resolve(ctx context.Context, sha string) (onair.Ref, error)
- type Deployments
Constants ¶
const DefaultBaseURL = "https://gitlab.com"
DefaultBaseURL is used when no self-hosted instance is configured.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an onair.Forge backed by one GitLab project. The zero value is not usable; construct with NewClient.
Its caches (resolved commits, compare counts, deployment answers) keep every answer for the client's lifetime, errors included, except a cancelled or timed-out request, which the next caller retries. A long-running host builds one Client per report, so an answer never goes stale.
func NewClient ¶
NewClient returns a Forge for repo ("group/project") on baseURL (empty means gitlab.com). An empty token works for public projects.
func (*Client) LatestGreen ¶
func (*Client) RequestURL ¶
type Deployments ¶
type Deployments struct {
Client *Client
Environment string // GitLab environment name, e.g. "production"
}
Deployments is an onair.LiveProvider that reads the deployments GitLab records for an environment: the newest successful one is Live, with Recorded confidence. It reports what CI recorded at deploy time, not what the host runs now.