config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const AppName = "strawpoll-cli"

Variables

This section is empty.

Functions

func ConfigExists

func ConfigExists() (bool, error)

ConfigExists checks whether the config file exists on disk.

func ConfigPath

func ConfigPath() (string, error)

func Dir

func Dir() (string, error)

func EnsureDir

func EnsureDir() (string, error)

func EnsureKeyringDir

func EnsureKeyringDir() (string, error)

func KeyringDir

func KeyringDir() (string, error)

func WriteConfig

func WriteConfig(cfg File) error

WriteConfig writes the YAML config file atomically using a .tmp + rename pattern.

Types

type File

type File struct {
	KeyringBackend    string `yaml:"keyring_backend,omitempty" json:"keyring_backend,omitempty"`
	Dupcheck          string `yaml:"dupcheck,omitempty" json:"dupcheck,omitempty"`
	ResultsVisibility string `yaml:"results_visibility,omitempty" json:"results_visibility,omitempty"`
	IsPrivate         *bool  `yaml:"is_private,omitempty" json:"is_private,omitempty"`
	AllowComments     *bool  `yaml:"allow_comments,omitempty" json:"allow_comments,omitempty"`
	AllowVPN          *bool  `yaml:"allow_vpn_users,omitempty" json:"allow_vpn_users,omitempty"`
	HideParticipants  *bool  `yaml:"hide_participants,omitempty" json:"hide_participants,omitempty"`
	EditVotePerms     string `yaml:"edit_vote_permissions,omitempty" json:"edit_vote_permissions,omitempty"`
}

File represents the strawpoll-cli YAML configuration.

func ReadConfig

func ReadConfig() (File, error)

ReadConfig reads the YAML config file. Returns zero File{} if file does not exist.

Jump to

Keyboard shortcuts

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