config

package
v0.0.0-...-5ab89ad Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustGetAppConfigPath

func MustGetAppConfigPath() string

Returns the path to the app config file. Panics on failure.

func MustReadAppCredentials

func MustReadAppCredentials() (string, string)

Reads the app credentials (ClientID and ClientSecret) from stdin

func MustWriteAppConfig

func MustWriteAppConfig(c *AppConfiguration)

Write the app configuration file. Panics on failure.

Types

type AppConfiguration

type AppConfiguration struct {
	ClientID     string              `json:"clientId"`
	ClientSecret string              `json:"clientSecret"`
	AuthToken    *oauth2.Token       `json:"authToken"`
	UserInfo     photosutil.UserInfo `json:"userInfo"`
}

Application configuration file structure

func ReadAppConfig

func ReadAppConfig() *AppConfiguration

Reads the app configuration file. If the file is not found, returns an empty config

type Settings

type Settings struct {
	// Directory name -> photos folder substitution CSV string; should
	// be formatted as old1,new1,old2,new2, ... where new1 replaces old1 etc
	NameSubstitutionTokens string

	// Whether to capitalize words in directory name when forming
	// folder names
	Capitalize bool

	// Whether to skip parsing folder year from the folder name; in this case,
	// file date will be used as the EXIF date.
	NoParseYear bool

	// Whether to skip (assume Yes) all confirmations)
	SkipConfirmation bool

	// Whether doing a 'dry run', ie not actually sending anything.
	DryRun bool

	// Whether to recurse into subdirectories
	Recurse bool

	// Maximum concurrency (number of simultaneous uploads)
	MaxConcurrency int

	// List of albums
	// TODO this may need to change
	Albums []*photos.Album
}

func MustGetSettings

func MustGetSettings() *Settings

func (*Settings) FindAlbum

func (s *Settings) FindAlbum(name string) *photos.Album

Jump to

Keyboard shortcuts

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