Documentation
¶
Overview ¶
Package gitlab implements the GitLab connector: read-only discovery of projects, effective permissions, and CI/CD variable metadata (PRD section 22, Phase 5).
Safety property: the GitLab variables API returns variable VALUES. This connector reads the endpoint for inventory purposes but stores only names and protection flags - values are dropped before anything reaches the graph. A unit test enforces this.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface {
GetCurrentUser(ctx context.Context) (login, name string, err error)
ListProjects(ctx context.Context) ([]Project, error)
ListVariables(ctx context.Context, projectPath string) ([]Variable, error)
}
API abstracts the GitLab API calls the connector needs.
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
Connector discovers GitLab infrastructure.
func (*Connector) Discover ¶
func (c *Connector) Discover(ctx context.Context) (*connectors.DiscoveryResult, error)
Discover implements connectors.Connector.
type Project ¶
type Project struct {
Name string
Path string // path with namespace, e.g. "org/payments-api"
Visibility string
DefaultBranch string
// AccessLevel is the authenticated principal's effective access
// (10 guest, 20 reporter, 30 developer, 40 maintainer, 50 owner).
AccessLevel int
}
Project is a discovered project.
type RestAPI ¶
type RestAPI struct {
// contains filtered or unexported fields
}
RestAPI implements API against a GitLab instance (gitlab.com or self-hosted) using a personal access token. All calls are read-only.
func NewRestAPI ¶
NewRestAPI builds a REST client. baseURL is e.g. https://gitlab.com (no trailing slash, no /api suffix).
func (*RestAPI) GetCurrentUser ¶
GetCurrentUser implements API.
func (*RestAPI) ListProjects ¶
ListProjects implements API.