core

package
v0.0.0-...-09eb631 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigUserFile   = "config.yml"
	ConfigSharedFile = "shared.yml"
)

Variables

This section is empty.

Functions

func CheckServerConfig

func CheckServerConfig(server string)

func ConcurrentRepositoryOperations

func ConcurrentRepositoryOperations(repos []string, fn RepoOperation) error

func CreateManifest

func CreateManifest()

func EditConfiguration

func EditConfiguration(configFile string) error

func ForEachRepo

func ForEachRepo(fn RepoOperation) error

func GetConfigPath

func GetConfigPath(configFile string) string

func GetConfigString

func GetConfigString() string

func IsSameType

func IsSameType(m Manifest, manifestType string) bool

func LoadCredentialItem

func LoadCredentialItem(item string, ptr *string, resetCredentials bool) (err error)

func LoadCredentials

func LoadCredentials(item string, username, password *string, resetCredentials bool) (err error)

func LoadKeyringItem

func LoadKeyringItem(item string, ptr *string) (err error)

func MustSetupConfig

func MustSetupConfig()

func ShowConfig

func ShowConfig(cfg *Configuration) error

Types

type ConcurrentResult

type ConcurrentResult struct {
	Output string
	Err    error
}

type ConcurrentResults

type ConcurrentResults map[string]ConcurrentResult

type Configuration

type Configuration struct {
	Git struct {
		NoVerify bool `yaml:"noVerify"`
	}
	GitHub struct {
		Organization, Username, Token string
		Reviewers                     []string
	}
	Users      []User
	Confluence ServiceConfiguration
	JIRA       struct {
		Server, Username, Password string
		Project, Board             string
		Transitions                []JIRATransition
		Enabled                    bool
	}
	ResetCredentials bool
}

func LoadConfiguration

func LoadConfiguration() (*Configuration, error)

func (*Configuration) PopulateUser

func (cfg *Configuration) PopulateUser(u *User) error

type Dependency

type Dependency struct {
	// name of the dependency
	Name string
	// optional, explicit name of the dependency.
	// if not defined the name will be <service>-<dependencyName> e.g. mainapp-mysql
	UniqueName string
	// e.g. postgres 9.6
	Version string
	// e.g. why it depends on it
	Description string
	// service, database, front-end
	Type string
	// not managed / controlled by us on AWS or GCP
	Dedicated bool
	// not managed / controlled by us on AWS or GCP
	External bool
	// e.g. most services don't communicate directly with a service.
	// like the service relies on it on putting a message/event in the broadcast queue
	Implicit bool
	// out (default), in (as in inbound network requests), both
	Direction string
}

type Deploy

type Deploy struct {
	Environment string
}

type Documentation

type Documentation struct {
	PageId      string   `yaml:"pageId"`
	IgnoredDirs []string `yaml:"ignoredDirs"`
}

type Environment

type Environment struct {
	Prefix, Region, Domain string
	JumpHost               string `yaml:"jumphost"`
}

type Git

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

func InitGit

func InitGit() *Git

func MustInitGit

func MustInitGit(repoDir string) *Git

func (*Git) CheckoutBranch

func (g *Git) CheckoutBranch() error

func (*Git) Clone

func (g *Git) Clone() (string, error)

func (*Git) CommitWithBranchName

func (g *Git) CommitWithBranchName() error

func (*Git) CommitWithIssueKey

func (g *Git) CommitWithIssueKey(cfg *Configuration, message string, extraArgs []string) error

func (*Git) ContainedUncommittedChanges

func (g *Git) ContainedUncommittedChanges() bool

func (*Git) CreateBranch

func (g *Git) CreateBranch(name string) error

func (*Git) CurrentHEAD

func (g *Git) CurrentHEAD() (string, error)

func (*Git) Diff

func (g *Git) Diff() (string, error)

func (*Git) Fetch

func (g *Git) Fetch() error

func (*Git) FetchTags

func (g *Git) FetchTags() error

func (*Git) ForceCreateBranch

func (g *Git) ForceCreateBranch(name string) error

func (*Git) GetCurrentBranch

func (g *Git) GetCurrentBranch() string

func (*Git) GetCurrentRepositoryName

func (g *Git) GetCurrentRepositoryName() string

func (*Git) GetIssueIdRegex

func (g *Git) GetIssueIdRegex() *regexp.Regexp

func (*Git) GetIssueKeyFromBranch

func (g *Git) GetIssueKeyFromBranch() string

func (*Git) GetIssueTypeFromBranch

func (g *Git) GetIssueTypeFromBranch() string

func (*Git) GetIssueTypeRegex

func (g *Git) GetIssueTypeRegex() *regexp.Regexp

func (*Git) GetPRRegex

func (g *Git) GetPRRegex() *regexp.Regexp

func (*Git) GetRepositoryRootPath

func (g *Git) GetRepositoryRootPath() (string, error)

func (*Git) GetTitleFromBranchName

func (g *Git) GetTitleFromBranchName() string

func (*Git) ISDirty

func (g *Git) ISDirty() bool

func (*Git) IsDifferentFromMaster

func (g *Git) IsDifferentFromMaster() bool

func (*Git) ListFileChanged

func (g *Git) ListFileChanged() []string

func (*Git) Log

func (g *Git) Log() (commits []*GitCommit)

func (*Git) LogNotInMasterBody

func (g *Git) LogNotInMasterBody() string

func (*Git) LogNotInMasterSubjects

func (g *Git) LogNotInMasterSubjects() []string

func (*Git) MustRunGitWithStdout

func (g *Git) MustRunGitWithStdout(args ...string) string

func (*Git) PendingChanges

func (g *Git) PendingChanges(cfg *Configuration, manifest *Manifest, previousVersion, currentVersion string, formatForSlack bool, noAt bool)

func (*Git) PickCommit

func (g *Git) PickCommit(commits []*GitCommit) (*GitCommit, error)

func (*Git) Push

func (g *Git) Push(cfg *Configuration) error

func (*Git) RunGit

func (g *Git) RunGit(args ...string) error

func (*Git) RunGitWithFullOutput

func (g *Git) RunGitWithFullOutput(args ...string) (string, error)

func (*Git) RunGitWithStdout

func (g *Git) RunGitWithStdout(args ...string) (string, error)

func (*Git) Sync

func (g *Git) Sync(unStash bool) (string, error)

type GitCommit

type GitCommit struct {
	Hash, Committer, Subject, Body string
}

type JIRATransition

type JIRATransition struct {
	Name, Alias string
}

type Manifest

type Manifest struct {
	Name          string
	Active        bool
	Repository    string
	LastUpdate    int64
	Platform      string // what is it running on
	Platforms     []string
	Language      string
	Languages     []string
	Types         []string
	Dependencies  []Dependency
	Protocols     []Protocol
	Version       string
	Branch        string
	Deploy        Deploy
	Documentation Documentation
	Readme        string
	ChangeLog     string
	Page          string
	Owners        Ownership
}

func LoadManifest

func LoadManifest() (*Manifest, error)

type Manifests

type Manifests []Manifest

func (Manifests) Len

func (e Manifests) Len() int

func (Manifests) Less

func (e Manifests) Less(i, j int) bool

func (Manifests) Swap

func (e Manifests) Swap(i, j int)

type Ownership

type Ownership map[string][]User

type Protocol

type Protocol struct {
	Type string
	Path string
}

type RepoOperation

type RepoOperation func(string) (string, error)

type ServiceConfiguration

type ServiceConfiguration struct {
	Server, Username, Password string
}

type User

type User struct {
	Name, Slack, Email string
	GitHub             string `yaml:"github"`
}

Jump to

Keyboard shortcuts

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