config

package
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Organizations       []Organization `json:"organizations"`
	Repositories        []string       `json:"repositories,omitempty"`
	ExcludeBranches     []string       `json:"exclude_branches,omitempty"`      // Regex patterns for branches to exclude
	WorkDir             string         `json:"work_dir,omitempty"`              // Working directory for cloning repositories
	ExcludeFromShowcase []string       `json:"exclude_from_showcase,omitempty"` // Repository names to exclude from showcase
}

Config holds the application configuration

func Load

func Load(path string) (*Config, error)

Load reads and parses the configuration file

func (*Config) FindCodebergOrg

func (c *Config) FindCodebergOrg() *Organization

FindCodebergOrg finds the first Codeberg organization

func (*Config) FindGitHubOrg

func (c *Config) FindGitHubOrg() *Organization

FindGitHubOrg finds the first GitHub organization

func (*Config) FindOrganization

func (c *Config) FindOrganization(host string) *Organization

FindOrganization finds an organization by host

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the configuration is valid

type Organization

type Organization struct {
	Host           string `json:"host"`
	Name           string `json:"name"`
	GitHubToken    string `json:"github_token,omitempty"`
	CodebergToken  string `json:"codeberg_token,omitempty"`
	BackupLocation bool   `json:"backupLocation,omitempty"` // Mark this as a backup-only destination
}

Organization represents a git organization with its host and name

func (*Organization) GetGitURL

func (o *Organization) GetGitURL() string

GetGitURL returns the git URL for an organization

func (*Organization) IsCodeberg

func (o *Organization) IsCodeberg() bool

IsCodeberg checks if the organization is Codeberg

func (*Organization) IsGitHub

func (o *Organization) IsGitHub() bool

IsGitHub checks if the organization is GitHub

func (*Organization) IsSSH

func (o *Organization) IsSSH() bool

IsSSH checks if the organization is a plain SSH location

Jump to

Keyboard shortcuts

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