utilities

package
v0.0.0-...-09387af Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Constants = Consts{
	EnvPrefix:   "FOLDCLI_",
	RootCmdName: "foldcli",
}

Functions

func CheckIfDirExists

func CheckIfDirExists(input string) bool

func FindSystemCommand

func FindSystemCommand(w io.Writer, command string, args []string) (*exec.Cmd, error)

func FindSystemCommandVersion

func FindSystemCommandVersion(w io.Writer, command string, hasPrefix bool, prefix string) (string, error)

func GenKeys

func GenKeys() ([]byte, []byte, error)

Generates public & private PEM encoded keys for Folderr's usage in its authentication handling. Returns privateKey, publicKey, error

func GetConfigDir

func GetConfigDir(dry bool) (string, error)

func GetGitToken

func GetGitToken() string

func IsFolderrInstalled

func IsFolderrInstalled(directory string) (bool, error)

Checks if Folderr is installed

May not be compliant with future versions of Folderr. Oh well.

func IsValidPath

func IsValidPath(input string) bool

func ManipulateDir

func ManipulateDir(input string) string

func ReadConfig

func ReadConfig(directory string, dry bool) (*viper.Viper, Config, SecretConfig, error)

Types

type Config

type Config struct {
	Directory  string   `json:"directory"`
	Repository string   `json:"repository"`
	CanInstall bool     `json:"CanInstall"`
	Database   DBConfig `json:"db" mapstructure:"db"`
}

type Consts

type Consts struct {
	EnvPrefix   string
	RootCmdName string
}

type DBConfig

type DBConfig struct {
	DbName string `json:"dbName"`
	Url    string `json:"url"`
}

type InitCheck

type InitCheck struct {
	Folderr  bool
	Database bool
}

func CheckInitialization

func CheckInitialization(config *Config) InitCheck

type SecretConfig

type SecretConfig struct {
	GitToken string
}

Jump to

Keyboard shortcuts

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