types

package
v0.10.30 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Red Render message with Red color.
	Red = color.FgRed.Render
	// Green Render message with Green color.
	Green = color.FgGreen.Render
	// Blue Render message with Blue color.
	Blue = color.FgBlue.Render
	// DotGitRx .git regexp.
	DotGitRx = regexp.MustCompile(`\.git$`)
)

Functions

func CheckAllValuesOrNone

func CheckAllValuesOrNone(parent string, theMap map[string]string) bool

CheckAllValuesOrNone TODO.

func GetHost

func GetHost(url string) string

GetHost TODO.

func GetMap

func GetMap(excludes []string) map[string]bool

GetMap TODO.

func ParseCronSpec

func ParseCronSpec(spec string) (cron.Schedule, error)

ParseCronSpec TODO.

func StatRemote

func StatRemote(remoteURL, sshURL string, repo GenRepo) bool

StatRemote TODO.

Types

type Conf

type Conf struct {
	Source      Source      `yaml:"source"`
	Destination Destination `yaml:"destination"`
	Cron        string      `yaml:"cron"`
	Log         Logging     `yaml:"log"`
	Metrics     Metrics     `yaml:"metrics"`
}

Conf TODO.

func (Conf) GetNextRun

func (conf Conf) GetNextRun() (*time.Time, error)

GetNextRun TODO.

func (Conf) HasAllPrometheusConf

func (conf Conf) HasAllPrometheusConf() bool

HasAllPrometheusConf TODO.

func (Conf) HasValidCronSpec

func (conf Conf) HasValidCronSpec() bool

HasValidCronSpec TODO.

func (Conf) MissingCronSpec

func (conf Conf) MissingCronSpec() bool

MissingCronSpec TODO.

type Destination

type Destination struct {
	Gitlab    []GenRepo `yaml:"gitlab"`
	Local     []Local   `yaml:"local"`
	Github    []GenRepo `yaml:"github"`
	Gitea     []GenRepo `yaml:"gitea"`
	Gogs      []GenRepo `yaml:"gogs"`
	OneDev    []GenRepo `yaml:"onedev"`
	Sourcehut []GenRepo `yaml:"sourcehut"`
}

Destination TODO.

func (Destination) Count

func (dest Destination) Count() int

Count TODO.

type FileLogging

type FileLogging struct {
	Dir    string `yaml:"dir"`
	File   string `yaml:"file"`
	MaxAge int    `yaml:"maxage"`
}

FileLogging TODO.

type Filter added in v0.10.14

type Filter struct {
	LastActivityString   string `yaml:"lastactivity"`
	LastActivityDuration time.Duration
	Stars                int      `yaml:"stars"`
	Languages            []string `yaml:"languages"`
	ExcludeArchived      bool     `yaml:"excludearchived"`
	ExcludeForks         bool     `yaml:"excludeforks"`
}

Filter struct

func (*Filter) ParseDuration added in v0.10.14

func (f *Filter) ParseDuration() error

type GenRepo

type GenRepo struct {
	Token          string     `yaml:"token"`
	TokenFile      string     `yaml:"token_file"`
	User           string     `yaml:"user"`
	Organization   string     `yaml:"organization"`
	SSH            bool       `yaml:"ssh"`
	SSHKey         string     `yaml:"sshkey"`
	Username       string     `yaml:"username"`
	Password       string     `yaml:"password"`
	URL            string     `yaml:"url"`
	Exclude        []string   `yaml:"exclude"`
	ExcludeOrgs    []string   `yaml:"excludeorgs"`
	Include        []string   `yaml:"include"`
	IncludeOrgs    []string   `yaml:"includeorgs"`
	Issues         bool       `yaml:"issues"`
	Wiki           bool       `yaml:"wiki"`
	Starred        bool       `yaml:"starred"`
	CreateOrg      bool       `yaml:"createorg"`
	Visibility     Visibility `yaml:"visibility"`
	Filter         Filter     `yaml:"filter"`
	Force          bool       `yaml:"force"`
	Contributed    bool       `yaml:"contributed"`
	MirrorInterval string     `yaml:"mirrorinterval"`
	LFS            bool       `yaml:"lfs"`
	Mirror         Mirror     `yaml:"mirror"`
}

GenRepo Generell Repo.

func (GenRepo) GetToken

func (grepo GenRepo) GetToken() string

GetToken TODO.

type GithubDestination added in v0.10.19

type GithubDestination struct {
	User         *github.User
	Organization *github.Organization
}

GithubDestination TODO

type HeartbeatConfig

type HeartbeatConfig struct {
	URLs []string `yaml:"urls"`
}

HeartbeatConfig TODO.

type Local

type Local struct {
	Bare       bool   `yaml:"bare"`
	Path       string `yaml:"path"`
	Structured bool   `yaml:"structured"`
	Zip        bool   `yaml:"zip"`
	Keep       int    `yaml:"keep"`
	LFS        bool   `yaml:"lfs"`
}

Local TODO.

type Logging

type Logging struct {
	Timeformat  string      `yaml:"timeformat"`
	FileLogging FileLogging `yaml:"file-logging"`
}

Logging TODO.

type Metrics

type Metrics struct {
	Prometheus  PrometheusConfig `yaml:"prometheus"`
	Heartbeat   HeartbeatConfig  `yaml:"heartbeat"`
	PushConfigs PushConfigs      `yaml:"push"`
}

Metrics TODO.

type Mirror added in v0.10.29

type Mirror struct {
	MirrorInterval string `yaml:"mirrorinterval"`
	Enabled        bool   `yaml:"enabled"`
}

Mirror struct

type PrometheusConfig

type PrometheusConfig struct {
	ListenAddr string `yaml:"listen_addr"`
	Endpoint   string `yaml:"endpoint"`
}

PrometheusConfig TODO.

type PushConfig added in v0.10.15

type PushConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Token    string `yaml:"token"`
	Url      string `yaml:"url"`
}

PushConfig TODO.

func (*PushConfig) ResolveToken added in v0.10.15

func (p *PushConfig) ResolveToken()

type PushConfigs added in v0.10.15

type PushConfigs struct {
	Ntfy   []*PushConfig `yaml:"ntfy"`
	Gotify []*PushConfig `yaml:"gotify"`
}

PushConfigs TODO.

type Repo

type Repo struct {
	Name          string
	URL           string
	SSHURL        string
	Token         string
	Defaultbranch string
	Origin        GenRepo
	Owner         string
	Hoster        string
	Description   string
	Issues        map[string]interface{}
	Private       bool
}

Repo TODO.

type Site

type Site struct {
	URL  string
	User string
	Port int
}

Site TODO.

func (*Site) GetValues

func (s *Site) GetValues(url string) error

GetValues TODO.

type Source

type Source struct {
	Gogs      []GenRepo `yaml:"gogs"`
	Gitlab    []GenRepo `yaml:"gitlab"`
	Github    []GenRepo `yaml:"github"`
	Gitea     []GenRepo `yaml:"gitea"`
	BitBucket []GenRepo `yaml:"bitbucket"`
	OneDev    []GenRepo `yaml:"onedev"`
	Sourcehut []GenRepo `yaml:"sourcehut"`
	Any       []GenRepo `yaml:"any"`
}

Source TODO.

func (Source) Count

func (source Source) Count() int

Count TODO.

type Visibility added in v0.10.9

type Visibility struct {
	Repositories  string `yaml:"repositories"`
	Organizations string `yaml:"organizations"`
}

Visibility struct

Jump to

Keyboard shortcuts

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