{"modulePath":"github.com/nvidia/doca-platform/hack/tools/dpfdev","version":"v0.0.0-20261202020107-608af116a20f","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitlab\n\n## Functions\n\n```go\nfunc IsForbidden(err error) bool\n```\nIsForbidden reports whether the error is a GitLab 403 response.\n\n```go\nfunc IsNotFound(err error) bool\n```\nIsNotFound reports whether the error is a GitLab 404 response.\n\n## Types\n\n```go\ntype APIError struct {\n\tStatusCode int\n\tBody       string\n}\n```\nAPIError is returned for GitLab API responses with a non-success status code, so callers can distinguish e.g. 403 (missing permission) from 404 (not found) and act on it.\n\n```go\nfunc (e *APIError) Error() string\n```\n\n```go\ntype Bridge struct {\n\tName               string `json:\"name\"`\n\tStatus             string `json:\"status\"`\n\tAllowFailure       bool   `json:\"allow_failure\"`\n\tDownstreamPipeline *struct {\n\t\tID     int    `json:\"id\"`\n\t\tStatus string `json:\"status\"`\n\t\tWebURL string `json:\"web_url\"`\n\t} `json:\"downstream_pipeline\"`\n}\n```\nBridge is a job that triggers a downstream (child or multi-project) pipeline.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient represents a GitLab API client\n\n```go\nfunc NewClient(endpoint, token, projectID string) *Client\n```\nNewClient creates a new GitLab API client\n\n```go\nfunc (c *Client) CreatePipelineSchedule(description, ref, cron, cronTimezone string, active bool) (*PipelineSchedule, error)\n```\nCreatePipelineSchedule creates a new pipeline schedule owned by the token's user. Requires the Developer role and access to the (possibly protected) ref.\n\n```go\nfunc (c *Client) CreatePipelineScheduleVariable(scheduleID int, key, value, variableType string) error\n```\nCreatePipelineScheduleVariable creates a new variable on a pipeline schedule. GitLab authorizes this with update\\_pipeline\\_schedule, which only the schedule owner (or an instance administrator) holds, so this fails with 403 for schedules owned by other users. Ownership is never changed by this call.\n\n```go\nfunc (c *Client) DeletePipelineSchedule(scheduleID int) error\n```\nDeletePipelineSchedule deletes a pipeline schedule. Unlike updates this only requires the Maintainer role, not schedule ownership.\n\n```go\nfunc (c *Client) DeletePipelineScheduleVariable(scheduleID int, key string) error\n```\nDeletePipelineScheduleVariable deletes a variable from a pipeline schedule. Like DeletePipelineSchedule this only requires the Maintainer role, not schedule ownership.\n\n```go\nfunc (c *Client) GetPipeline(pipelineID int) (*PipelineDetails, error)\n```\nGetPipeline retrieves a single pipeline including its detailed status.\n\n```go\nfunc (c *Client) GetPipelineSchedule(scheduleID int) (*PipelineSchedule, error)\n```\nGetPipelineSchedule retrieves a single pipeline schedule including its variables. Reading the variables of a schedule owned by another user works with the Maintainer role or above and does not require taking ownership; for callers below Maintainer that do not own the schedule, GitLab omits the variables field and Variables is nil.\n\n```go\nfunc (c *Client) ListJobs(w io.Writer, start time.Time) ([]Job, error)\n```\nListJobs retrieves all jobs for a project within the given date range\n\n```go\nfunc (c *Client) ListPipelineBridges(pipelineID int) ([]Bridge, error)\n```\nListPipelineBridges retrieves the trigger jobs of a pipeline with their downstream pipelines. Failures of downstream pipelines do not appear in the pipeline's own jobs list.\n\n```go\nfunc (c *Client) ListPipelineSchedules() ([]PipelineSchedule, error)\n```\nListPipelineSchedules retrieves all pipeline schedules of the project. The list endpoint does not include variables; use GetPipelineSchedule for a single schedule with its variables.\n\n```go\nfunc (c *Client) ListSchedulePipelines(scheduleID int, since time.Time) ([]SchedulePipeline, error)\n```\nListSchedulePipelines retrieves the pipelines triggered by a schedule that were created at or after since, oldest first. A zero since returns all of them. The endpoint has no date filter and no documented order, so every page is fetched and filtered here.\n\n```go\nfunc (c *Client) TakeOwnershipPipelineSchedule(scheduleID int) (*PipelineSchedule, error)\n```\nTakeOwnershipPipelineSchedule makes the token's user the owner of the schedule and returns the updated schedule. Requires the Maintainer role. This is one-way: GitLab has no way to assign ownership to another user, so the previous owner can only get the schedule back by taking ownership themselves. From this call on, the schedule runs with the new owner's permissions.\n\n```go\nfunc (c *Client) UpdatePipelineSchedule(scheduleID int, description, ref, cron, cronTimezone string, active bool) error\n```\nUpdatePipelineSchedule updates the schedule's fields. Like the variable modification calls it requires the schedule owner's token (or instance admin) and returns 403 otherwise; ownership is never changed by this call.\n\n```go\nfunc (c *Client) UpdatePipelineScheduleVariable(scheduleID int, key, value, variableType string) error\n```\nUpdatePipelineScheduleVariable updates the value of an existing pipeline schedule variable. Like CreatePipelineScheduleVariable it requires the schedule owner's token (or instance admin) and returns 403 otherwise; ownership is never changed by this call. Returns 404 if the variable does not exist on the schedule.\n\n```go\ntype Job struct {\n\tID        int       `json:\"id\"`\n\tName      string    `json:\"name\"`\n\tStatus    string    `json:\"status\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tDuration  float64   `json:\"duration\"`\n\tPipeline  struct {\n\t\tID int `json:\"id\"`\n\t} `json:\"pipeline\"`\n\tBranch string `json:\"ref\"`\n\tURL    string `json:\"web_url\"`\n\tRunner *struct {\n\t\tID          int    `json:\"id\"`\n\t\tDescription string `json:\"description\"`\n\t} `json:\"runner,omitempty\"`\n}\n```\nJob represents a GitLab CI job\n\n```go\ntype PipelineDetails struct {\n\tID     int    `json:\"id\"`\n\tStatus string `json:\"status\"`\n\t// DetailedStatus.Label is what the UI shows, e.g. \"passed with warnings\"\n\t// for a pipeline whose status is success but an allowed-to-fail job failed.\n\tDetailedStatus struct {\n\t\tLabel string `json:\"label\"`\n\t} `json:\"detailed_status\"`\n}\n```\nPipelineDetails holds the fields of a single pipeline that its list representation lacks.\n\n```go\ntype PipelineSchedule struct {\n\tID           int       `json:\"id\"`\n\tDescription  string    `json:\"description\"`\n\tRef          string    `json:\"ref\"`\n\tCron         string    `json:\"cron\"`\n\tCronTimezone string    `json:\"cron_timezone\"`\n\tActive       bool      `json:\"active\"`\n\tNextRunAt    time.Time `json:\"next_run_at\"`\n\tOwner        struct {\n\t\tUsername string `json:\"username\"`\n\t\tName     string `json:\"name\"`\n\t} `json:\"owner\"`\n\tVariables []PipelineScheduleVariable `json:\"variables\"`\n}\n```\nPipelineSchedule represents a GitLab pipeline schedule. Variables are only populated by GetPipelineSchedule, and only when the caller has the Maintainer role or above (or owns the schedule); GitLab omits the field otherwise, which is reflected here as a nil slice.\n\n```go\ntype PipelineScheduleVariable struct {\n\tKey          string `json:\"key\"`\n\tVariableType string `json:\"variable_type\"`\n\tValue        string `json:\"value\"`\n\tRaw          bool   `json:\"raw\"`\n}\n```\nPipelineScheduleVariable represents a variable of a pipeline schedule.\n\n```go\ntype SchedulePipeline struct {\n\tID        int       `json:\"id\"`\n\tStatus    string    `json:\"status\"`\n\tSource    string    `json:\"source\"`\n\tRef       string    `json:\"ref\"`\n\tSHA       string    `json:\"sha\"`\n\tWebURL    string    `json:\"web_url\"`\n\tCreatedAt time.Time `json:\"created_at\"`\n\tUpdatedAt time.Time `json:\"updated_at\"`\n}\n```\nSchedulePipeline is a pipeline triggered by a pipeline schedule.\n\n","path":"github.com/nvidia/doca-platform/hack/tools/dpfdev/pkg/gitlab","name":"gitlab","synopsis":"","isRedistributable":true}
