config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepoConfiguration

type RepoConfiguration struct {
	Repositories map[string]*Repository `json:"repositories"`
}

RepoConfiguration is a slice of Repository values.

func Load

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

func Parse

func Parse(in io.Reader) (*RepoConfiguration, error)

Parse reads and returns a configuration from Reader.

func (RepoConfiguration) ApplyOverrides added in v1.0.0

func (c RepoConfiguration) ApplyOverrides() RepoConfiguration

ApplyOverrides will decide if and how to apply cli values when there is a matching config with existing repositories

func (RepoConfiguration) Find

func (c RepoConfiguration) Find(repoKey string) *Repository

Find looks up the repository by key in a list or RepoConfiguration.Repositories.

func (RepoConfiguration) Keys added in v1.0.0

func (c RepoConfiguration) Keys() []string

Keys returns the Repository keys in RepoConfiguration.Repositories.

type Repository

type Repository struct {
	Name               string     `json:"name"`
	Disabled           bool       `json:"disabled,omitempty"`
	SourceRepo         string     `json:"sourceRepo"`
	SourceBranch       string     `json:"sourceBranch"`
	FilePath           string     `json:"filePath"`
	UpdateKey          string     `json:"updateKey"`
	BranchGenerateName string     `json:"branchGenerateName"`
	DisablePRCreation  bool       `json:"disablePRCreation,omitempty"`
	RemoveKey          bool       `json:"removeKey,omitempty"`
	RemoveFile         bool       `json:"removeFile,omitempty"`
	CreateMissing      bool       `json:"createMissing,omitempty"`
	CommitMsg          string     `json:"commitMsg,omitempty"`
	Signature          *Signature `json:"signature,omitempty"`
}

Repository is the items that are required to update a specific file in a repo.

type Signature

type Signature struct {
	Name  string `json:"name,omitempty"`
	Email string `json:"email,omitempty"`
}

Signature represents a git commit creator by name and email

Jump to

Keyboard shortcuts

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