config

package
v0.0.0-...-fb40ba6 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(filename string) (*viper.Viper, error)

Load the holgersync config file

Types

type Config

type Config struct {
	HolgersyncConfig HolgersyncConfig
	Logger           Logger
}

func ParseConfig

func ParseConfig(v *viper.Viper) *Config

TODO

type GitConfig

type GitConfig struct {
	Username            string `yaml:"username"`
	PersonalAccessToken string `yaml:"personalAccessToken"`
	Remote              string `yaml:"remote"`
	Branch              string `yaml:"branch"`
}

type GlobalConfig

type GlobalConfig struct {
	Git []GitConfig `mapstructure:"gitConfig"`
}

type HolgersyncConfig

type HolgersyncConfig struct {
	SourceFileConfig SourceFileConfig `yaml:"sourceFileConfig"`
	Targets          []Target         `mapstructure:"Targets"`
}

type Logger

type Logger struct {
	Level       string
	Destination string
}

type Parameter

type Parameter struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type SourceFileConfig

type SourceFileConfig struct {
	FilePath  string `yaml:"filePath"`
	RootPath  string `yaml:"rootPath"`
	FileRegex string `yaml:"fileRegex"`
}

type Target

type Target struct {
	Path       string      `yaml:"path"`
	Git        []GitConfig `mapstructure:"gitConfig"`
	Parameters []Parameter `mapstructure:"parameters"`
}

func (*Target) CheckFileStatusCode

func (t *Target) CheckFileStatusCode(filePath string) (*git.StatusCode, error)

func (*Target) CommitAndPush

func (t *Target) CommitAndPush(file string) error

func (*Target) CreateHolgersyncBranch

func (t *Target) CreateHolgersyncBranch() error

Create the desired Holgersync branch, if the branch already exists do nothing

Jump to

Keyboard shortcuts

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