configfile

package
v12.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package configfile provides functionality around storing Git Town configuration information in a dedicated configuration file.

Index

Constants

View Source
const FileName = ".git-branches.toml"

Variables

This section is empty.

Functions

func Load

func Load() (*configdomain.PartialConfig, error)

func RenderPerennialBranches

func RenderPerennialBranches(perennials gitdomain.LocalBranchNames) string

func RenderTOML

func RenderTOML(config *configdomain.FullConfig) string

func Save

func Save(config *configdomain.FullConfig) error

func TOMLComment

func TOMLComment(text string) string

func Validate

func Validate(data Data) (configdomain.PartialConfig, error)

Validate converts the given low-level configfile data into high-level config data.

Types

type Branches

type Branches struct {
	Main           *string  `toml:"main"`
	Perennials     []string `toml:"perennials"`
	PerennialRegex *string  `toml:"perennial-regex"`
}

func (Branches) IsEmpty

func (self Branches) IsEmpty() bool

type Data

type Data struct {
	Branches                 *Branches     `toml:"branches"`
	Hosting                  *Hosting      `toml:"hosting"`
	PushHook                 *bool         `toml:"push-hook"`
	PushNewbranches          *bool         `toml:"push-new-branches"`
	ShipDeleteTrackingBranch *bool         `toml:"ship-delete-tracking-branch"`
	SyncBeforeShip           *bool         `toml:"sync-before-ship"`
	SyncStrategy             *SyncStrategy `toml:"sync-strategy"`
	SyncUpstream             *bool         `toml:"sync-upstream"`
}

Data defines the Go equivalent of the TOML file content.

func Decode

func Decode(text string) (*Data, error)

Decode converts the given config file TOML source into Go data.

type Hosting

type Hosting struct {
	OriginHostname *string `toml:"origin-hostname"`
	Platform       *string `toml:"platform"`
}

func (Hosting) IsEmpty

func (self Hosting) IsEmpty() bool

type SyncStrategy

type SyncStrategy struct {
	FeatureBranches   *string `toml:"feature-branches"`
	PerennialBranches *string `toml:"perennial-branches"`
}

func (SyncStrategy) IsEmpty

func (self SyncStrategy) IsEmpty() bool

Jump to

Keyboard shortcuts

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