config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Name           string   `scfg:",param"`
	Server         string   `scfg:"server"`
	Username       string   `scfg:"username"`
	PasswordCmd    []string `scfg:"password-cmd"` // Command and arguments to retrieve password.
	LocalPath      string   `scfg:"local-path"`
	PostSyncCmd    []string `scfg:"post-sync-cmd"` // Command to run after each sync.
	MaxConnections int      `scfg:"max-connections"`
	Ignore         []Ignore `scfg:"ignore"`

	// Runtime-resolved commands.
	Password  string
	Plaintext bool

	// Testing only.
	StateDir string
}

Account represents a single IMAP account configuration.

func (Account) IgnoreRegexes added in v0.4.2

func (a Account) IgnoreRegexes() ([]regexp.Regexp, error)

func (*Account) ResolvePassword

func (a *Account) ResolvePassword() error

ResolvePassword executes the password-cmd and stores the result in Password field. The password is read from stdout and trimmed of whitespace/newlines.

func (*Account) ResolveServer added in v0.3.1

func (a *Account) ResolveServer(ctx context.Context) error

ResolveServer discovers the IMAP server via SRV records if not explicitly configured. If Server is already set, this is a no-op.

type Config

type Config struct {
	Accounts []Account `scfg:"account"`
}

Config represents the ImapGoose configuration.

func Load

func Load(path string) (*Config, error)

Load reads and parses the configuration file.

type Ignore added in v0.4.2

type Ignore struct {
	Value string `scfg:",param"`
}

Ignore directive.

Jump to

Keyboard shortcuts

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