gitlab

package
v3.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2026 License: BSD-3-Clause Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*gitlab.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts ...Option) (*Client, error)

NewClient builds a GitLab client from the given options. host and token are required; a bad configuration is an error rather than a panic, so a server can report it instead of dying.

func NewClientFromViper added in v3.0.1

func NewClientFromViper() (*Client, error)

NewClientFromViper builds a client from the global config. It is the CLI's entry point, keeping the single-token model; the web server uses NewClient with a per-user token instead.

func (*Client) AddGroupGuests

func (c *Client) AddGroupGuests(courseName string) error

AddGroupGuests adds all students from an assignment config as guests to the course subgroup (coursepath/semesterpath). This enables students to use the Dependency-Proxy.

func (*Client) Archive

func (c *Client) Archive(assignmentCfg *config.AssignmentConfig, unarchive bool) error

func (*Client) CheckCourse

func (c *Client) CheckCourse(cfg *config.CourseConfig) bool

func (*Client) Delete

func (c *Client) Delete(assignmentCfg *config.AssignmentConfig) error

func (*Client) Generate

func (c *Client) Generate(assignmentCfg *config.AssignmentConfig) error

func (*Client) ProtectToBranch

func (c *Client) ProtectToBranch(assignmentCfg *config.AssignmentConfig) error

func (*Client) Push

func (c *Client) Push(assignmentCfg *config.AssignmentConfig, branchname string) error

func (*Client) Report

func (c *Client) Report(assignmentCfg *config.AssignmentConfig, templateFile *string, output *string) error

func (*Client) ReportData added in v3.16.0

func (c *Client) ReportData(assignmentCfg *config.AssignmentConfig) (*r.Reports, error)

ReportData returns the structured report for an assignment without rendering it to text/HTML. It is the data-returning entry point the web server uses; the CLI's Report/ReportHTML render this same data.

func (*Client) ReportHTML

func (c *Client) ReportHTML(assignmentCfg *config.AssignmentConfig, templateFile *string, output *string) error

func (*Client) ReportJSON

func (c *Client) ReportJSON(assignmentCfg *config.AssignmentConfig, output *string) error

func (*Client) Setaccess

func (c *Client) Setaccess(assignmentCfg *config.AssignmentConfig) error

func (*Client) Update

func (c *Client) Update(assignmentCfg *config.AssignmentConfig) error

type Option added in v3.0.1

type Option func(*clientOptions)

func WithHTTPClient added in v3.0.1

func WithHTTPClient(hc *http.Client) Option

WithHTTPClient injects the underlying HTTP client.

func WithHost added in v3.0.1

func WithHost(host string) Option

func WithReporter added in v3.0.1

func WithReporter(r reporter.Reporter) Option

WithReporter sets where the client's progress goes. Defaults to a ConsoleReporter (spinners on stdout); the web server passes a streaming one.

func WithToken added in v3.0.1

func WithToken(token string) Option

func WithoutRetries added in v3.0.1

func WithoutRetries() Option

WithoutRetries disables the client's retry-on-5xx wrapper. The contract tests use it so a mocked 5xx returns immediately instead of retrying with backoff.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL