projects

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package projects holds the data structures and logic necessary to interact with the Gitlab API and enumerate projects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGroupByName

func FindGroupByName(ctx context.Context, client *gitlab.Client, groupName string) (*gitlab.Group, error)

FindGroupByName searches for a group by name using the provided Gitlab client. If the group is found, it is returned. If the group is not found, an error is returned.

Types

type EnumerateProjectsOptions

type EnumerateProjectsOptions struct {
	Mine     bool   `json:"mine"`
	Archived bool   `json:"archived"`
	GroupID  string `json:"group_id"`
}

EnumerateProjectsOptions holds the options for enumerating projects. The Mine field is used to filter projects that are owned by the authenticated user, only returning projects that are owned by the authenticated user when set to true. The Archived field is used to filter for archived projects, including archived when set to true. The GroupID field is used to filter projects by group ID, only returning projects that are part of the specified group.

type GitlabResourceReport

type GitlabResourceReport struct {
	BaseURL   string          `json:"base_url" yaml:"base_url"`
	Resources GitlabResources `json:"resources" yaml:"resources"`
	Errors    []string        `json:"errors" yaml:"errors"`
}

GitlabResourceReport represents a report of Gitlab resources and non-fatal errors encountered during enumeration.

func EnumerateProjects

func EnumerateProjects(ctx context.Context, baseURL string, options *EnumerateProjectsOptions, client *gitlab.Client) (*GitlabResourceReport, error)

EnumerateProjects enumerates projects using the provided Gitlab client and options. The function returns a GitlabResourceReport containing the resources and non-fatal errors encountered during the enumeration process.

func EnumerateProjectsForGroup

func EnumerateProjectsForGroup(ctx context.Context, baseURL string, client *gitlab.Client, options *EnumerateProjectsOptions) (*GitlabResourceReport, error)

EnumerateProjectsForGroup enumerates projects for a specific group using the provided Gitlab client and options. The function returns a GitlabResourceReport containing the resources and non-fatal errors encountered during the enumeration process.

type GitlabResources

type GitlabResources struct {
	Projects []*gitlab.Project `json:"projects" yaml:"projects"`
}

GitlabResources represents a collection of Gitlab projects.

Jump to

Keyboard shortcuts

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