projects

package
v0.0.3 Latest Latest
Warning

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

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

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