config

package
v0.0.0-...-e237f2d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DirectoryMode is the default mode to apply to directories.
	DirectoryMode os.FileMode = 0755

	// ExecutableMode is the default mode for executable files.
	ExecutableMode os.FileMode = 0755

	// FileMode is the default mode to apply to files.
	FileMode os.FileMode = 0644

	KeyBackupPlexDest      string = "backup.plex.dest"
	KeyBackupPlexSrc       string = "backup.plex.src"
	KeyNASFQDN             string = "nas.fqdn"
	KeySCPChownGID         string = "scp.chown.gid"
	KeySCPChownGroup       string = "scp.chown.group"
	KeySCPChownUID         string = "scp.chown.uid"
	KeySCPChownUser        string = "scp.chown.user"
	KeySCPDestAnimesPaths  string = "scp.dest.animespaths"
	KeySCPDestMoviesPaths  string = "scp.dest.moviespaths"
	KeySCPDestTVShowsPaths string = "scp.dest.tvshowspaths"
	KeySSHClientKnownHosts string = "ssh.client.knownhosts"
	KeySSHClientPrivateKey string = "ssh.client.privatekey"
	KeySSHHost             string = "ssh.host"
	KeySSHPort             string = "ssh.port"
	KeySSHUser             string = "ssh.user"
	KeySubsyncOptions      string = "subsync.options"
)

Variables

View Source
var (
	// Application name, overridden as ldflag.
	AppName = "nas-cli"

	// Build timestamp, overridden as ldflag.
	BuildDate = "N/A"

	// Compiler toolchain that was used to build the binary.
	Compiler = fmt.Sprintf("%s/%s", runtime.Compiler, runtime.Version())

	// Last git commit hash, overridden as ldflag.
	GitCommit = "0000000000000000000000000000000000000000"

	// System OS and architecture the binary is built for.
	Platform = fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)

	// Version is the Calendar Versioning string, overridden as ldflag.
	Version = "latest"
)

Variables overridden with ldflags.

View Source
var (
	// GID is the processed files group to set.
	GID int

	// Configuration directory.
	Dir string

	// Configuration file name.
	Filename string = ".nascliconfig"

	// Configuration keys in INI file order.
	OrderedKeys = []string{
		KeyNASFQDN,
		KeyBackupPlexSrc,
		KeyBackupPlexDest,
		KeySCPChownGID,
		KeySCPChownGroup,
		KeySCPChownUID,
		KeySCPChownUser,
		KeySCPDestAnimesPaths,
		KeySCPDestMoviesPaths,
		KeySCPDestTVShowsPaths,
		KeySSHHost,
		KeySSHPort,
		KeySSHUser,
		KeySSHClientKnownHosts,
		KeySSHClientPrivateKey,
		KeySubsyncOptions,
	}

	// UID is the processed files owner to set.
	UID int

	// WD is the working directory's absolute path.
	WD string
)

Functions

func Save

func Save() error

Types

type Backup

type Backup struct {
	Plex Plex `yaml:"plex"`
}

type Chown

type Chown struct {
	UID   int    `yaml:"uid"`
	User  string `yaml:"user"`
	GID   int    `yaml:"gid"`
	Group string `yaml:"group"`
}

type Client

type Client struct {
	KnownHosts string `yaml:"knownhosts"`
	PrivateKey string `yaml:"privatekey"`
}

type Config

type Config struct {
	NAS     NAS     `yaml:"nas"`
	Backup  Backup  `yaml:"backup"`
	SCP     SCP     `yaml:"scp"`
	SSH     SSH     `yaml:"ssh"`
	Subsync Subsync `yaml:"subsync"`
}

type Dest

type Dest struct {
	AnimesPaths  []string `yaml:"animespaths"`
	MoviesPaths  []string `yaml:"moviespaths"`
	TVShowsPaths []string `yaml:"tvshowspaths"`
}

type NAS

type NAS struct {
	FQDN string `yaml:"fqdn"`
}

type Plex

type Plex struct {
	Src  string `yaml:"src"`
	Dest string `yaml:"dest"`
}

type SCP

type SCP struct {
	Chown Chown `yaml:"chown"`
	Dest  Dest  `yaml:"dest"`
}

type SSH

type SSH struct {
	Host   string `yaml:"host"`
	Port   int    `yaml:"port"`
	User   string `yaml:"user"`
	Client Client `yaml:"client"`
}

type Subsync

type Subsync struct {
	Options []string `yaml:"options"`
}

Jump to

Keyboard shortcuts

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