gitlab

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindGitLabWorkflows

func FindGitLabWorkflows(repoPath string) ([]parser.WorkflowFile, error)

FindGitLabWorkflows searches for GitLab CI/CD files in a repository

func GitLabRules

func GitLabRules() []rules.Rule

GitLabRules returns GitLab CI/CD specific security rules

func IsGitLabURL

func IsGitLabURL(repoURL string) bool

IsGitLabURL checks if a URL is a GitLab repository URL

func LoadSingleGitLabWorkflow

func LoadSingleGitLabWorkflow(filePath string) ([]parser.WorkflowFile, error)

LoadSingleGitLabWorkflow loads and parses a single GitLab CI file

func ParseRepositoryURL

func ParseRepositoryURL(repoURL string) (instanceURL, owner, repo string, err error)

ParseRepositoryURL parses a GitLab repository URL and detects the instance

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents a GitLab repository client

func NewClient

func NewClient(instanceURL string) (*Client, error)

NewClient creates a new GitLab client instanceURL can be: - "" or "https://gitlab.com" for GitLab SaaS - "https://gitlab.company.com" for on-premise instances

func (*Client) CloneRepository

func (c *Client) CloneRepository(repoURL, tempDir string) (string, error)

CloneRepository clones a GitLab repository to a temporary directory

func (*Client) ValidateConnection

func (c *Client) ValidateConnection() error

ValidateConnection tests basic connectivity to the GitLab instance

type GitLabJob

type GitLabJob struct {
	Stage        string                   `yaml:"stage"`
	Image        interface{}              `yaml:"image"`
	Script       []string                 `yaml:"script"`
	BeforeScript []string                 `yaml:"before_script"`
	AfterScript  []string                 `yaml:"after_script"`
	Variables    map[string]interface{}   `yaml:"variables"`
	Rules        []map[string]interface{} `yaml:"rules"`
	Only         interface{}              `yaml:"only"`
	Except       interface{}              `yaml:"except"`
	When         string                   `yaml:"when"`
	Allow        map[string]interface{}   `yaml:"allow_failure"`
	Artifacts    map[string]interface{}   `yaml:"artifacts"`
	Cache        map[string]interface{}   `yaml:"cache"`
	Services     []interface{}            `yaml:"services"`
	Needs        []interface{}            `yaml:"needs"`
	Tags         []string                 `yaml:"tags"`
	Environment  map[string]interface{}   `yaml:"environment"`
}

GitLabJob represents a job in GitLab CI/CD

type GitLabWorkflow

type GitLabWorkflow struct {
	Stages    []string                 `yaml:"stages"`
	Image     interface{}              `yaml:"image"`
	Variables map[string]interface{}   `yaml:"variables"`
	Before    []string                 `yaml:"before_script"`
	After     []string                 `yaml:"after_script"`
	Jobs      map[string]GitLabJob     `yaml:",inline"`
	Include   []map[string]interface{} `yaml:"include"`
	Workflow  map[string]interface{}   `yaml:"workflow"`
}

GitLabWorkflow represents a GitLab CI/CD pipeline

Jump to

Keyboard shortcuts

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