Documentation
¶
Index ¶
- Variables
- type FetchConfig
- type Git
- type GitPusher
- type GitPusherConfig
- type GitPusherPoolConfig
- type ManifestConfig
- type ManifestFile
- type NewGitPusherArgs
- type PackPusher
- type ProjectConfig
- type ProjectLister
- type ProjectName
- type PushState
- type Pusher
- type PusherStat
- type RepoConfig
- type RepoName
- type RepoStat
- type RepoWatcher
- type RepoWatcherState
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProjectNotFound = errors.New("project not found")
Functions ¶
This section is empty.
Types ¶
type FetchConfig ¶
type FetchConfig struct {
FetchRefSpecs []string `yaml:"fetch-ref-spec"`
PushInterval time.Duration `yaml:"push-interval"`
LFS bool `yaml:"lfs"`
Workers int `yaml:"workers"`
PackPushInterval time.Duration `yaml:"pack-push-interval"`
PackingStrategy binding.PackingStrategy `yaml:"packing-strategy"`
}
func (*FetchConfig) Override ¶
func (f *FetchConfig) Override(g *FetchConfig)
type Git ¶
type Git interface {
AllObjects(repoPath string) ([]entities.Hash, error)
RevListAll(repoPath string) ([]entities.Hash, error)
PackObjects(repoPath string, prefix string, objects []entities.Hash) (string, error)
AllCommitsDates(repoPath string) ([]entities.Hash, []time.Time, error)
CommitTreeHashes(root string, commits []entities.Hash) ([]entities.Hash, error)
CommitsFileObjects(root string, commits []entities.Hash) ([]entities.Hash, error)
ObjectTypes(repoPath string, objects []entities.Hash) ([]string, error)
}
type GitPusher ¶
type GitPusher struct {
// contains filtered or unexported fields
}
func NewGitPusher ¶
func NewGitPusher(args *NewGitPusherArgs) *GitPusher
type GitPusherConfig ¶
type GitPusherConfig struct {
Name string `yaml:"name"`
Index *int `yaml:"index"`
Inactive bool `yaml:"inactive"`
URL string `yaml:"url"`
Port int `yaml:"port"`
MaxRemotePushes int `yaml:"max-remote-pushes"`
MaxProjectsSyncs int `yaml:"max-projects-syncs"`
MaxMemoryUsage float64 `yaml:"max-memory-usage"`
}
type GitPusherPoolConfig ¶
type GitPusherPoolConfig struct {
Name string `yaml:"name"`
PushersCount int `yaml:"pushers-count"`
Pushers []*GitPusherConfig `yaml:"pushers"`
Repos []*RepoConfig `yaml:"repos"`
Projects []*ProjectConfig `yaml:"projects"`
Defaults struct {
NamePattern string `yaml:"name-pattern"`
Port int `yaml:"port"`
MaxRemotePushes int `yaml:"max-remote-pushes"`
MaxProjectsSyncs int `yaml:"max-projects-syncs"`
MaxMemoryUsage float64 `yaml:"max-memory-usage"`
} `yaml:"defaults"`
}
func (*GitPusherPoolConfig) Instance ¶
func (c *GitPusherPoolConfig) Instance(name string) (*GitPusherConfig, error)
func (*GitPusherPoolConfig) Validate ¶
func (c *GitPusherPoolConfig) Validate() error
Validate checks if the configuration is valid. It also populates some internal fields and default values.
type ManifestConfig ¶
type ManifestFile ¶
type NewGitPusherArgs ¶
type PackPusher ¶
type PackPusher struct {
// contains filtered or unexported fields
}
func NewPackPusher ¶
func NewPackPusher(client remote.RemoteProvider, server, project, gitRoot string, git Git, strategy binding.PackingStrategy) (*PackPusher, error)
type ProjectConfig ¶
type ProjectConfig struct {
Server string `yaml:"server"`
Project string `yaml:"project"`
URL string `yaml:"url"`
FetchConfig `yaml:",inline"`
}
func (*ProjectConfig) Name ¶
func (c *ProjectConfig) Name() ProjectName
func (*ProjectConfig) Validate ¶
func (c *ProjectConfig) Validate() error
type ProjectLister ¶
type ProjectLister interface {
ListProjects(ctx context.Context) ([]*ProjectConfig, error)
Stat() RepoStat
}
type ProjectName ¶
type ProjectName string
func (ProjectName) String ¶
func (p ProjectName) String() string
type PusherStat ¶
type RepoConfig ¶
type RepoConfig struct {
Manifest ManifestConfig `yaml:"manifest"`
ProjectDefaults FetchConfig `yaml:"project-defaults"`
Overrides []struct {
Name string `yaml:"name"`
Regex bool `yaml:"regex"`
RegexPattern *regexp.Regexp `yaml:"-"`
Exclude bool `yaml:"exclude"`
FetchConfig `yaml:",inline"`
} `yaml:"overrides"`
}
func (*RepoConfig) Name ¶
func (c *RepoConfig) Name() RepoName
func (*RepoConfig) Validate ¶
func (c *RepoConfig) Validate() error
type RepoWatcher ¶
type RepoWatcher struct {
// contains filtered or unexported fields
}
func (*RepoWatcher) ListProjects ¶
func (m *RepoWatcher) ListProjects(ctx context.Context) (projects []*ProjectConfig, err error)
ListProjects implements ProjectLister.
type RepoWatcherState ¶
type RepoWatcherState int
const ( RepoWatcherCreated RepoWatcherState = iota RepoWatcherInitialized RepoWatcherSleep RepoWatcherFetch RepoWatcherManifestRead )
func (RepoWatcherState) String ¶
func (s RepoWatcherState) String() string
Click to show internal directories.
Click to hide internal directories.