config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppName         = "pm-cli"
	KeyringUser     = "bridge-password"
	DefaultIMAP     = "127.0.0.1"
	DefaultIMAPPort = 1143
	DefaultSMTP     = "127.0.0.1"
	DefaultSMTPPort = 1025
)

Variables

This section is empty.

Functions

func CheckIdempotencyKey

func CheckIdempotencyKey(key string) (bool, error)

CheckIdempotencyKey returns true if the key was already used (within TTL)

func ConfigDir

func ConfigDir() (string, error)

func ConfigPath

func ConfigPath() (string, error)

func DeletePassword

func DeletePassword(email string) error

func Exists

func Exists() bool

func RecordIdempotencyKey

func RecordIdempotencyKey(key string) error

RecordIdempotencyKey marks a key as used

Types

type BridgeConfig

type BridgeConfig struct {
	IMAPHost string `yaml:"imap_host"`
	IMAPPort int    `yaml:"imap_port"`
	SMTPHost string `yaml:"smtp_host"`
	SMTPPort int    `yaml:"smtp_port"`
	Email    string `yaml:"email"`
}

type Config

type Config struct {
	Bridge   BridgeConfig   `yaml:"bridge"`
	Defaults DefaultsConfig `yaml:"defaults"`
}

func DefaultConfig

func DefaultConfig() *Config

func Load

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

func (*Config) GetPassword

func (c *Config) GetPassword() (string, error)

func (*Config) Save

func (c *Config) Save(path string) error

func (*Config) SetPassword

func (c *Config) SetPassword(password string) error

type DefaultsConfig

type DefaultsConfig struct {
	Mailbox string `yaml:"mailbox"`
	Limit   int    `yaml:"limit"`
	Format  string `yaml:"format"`
}

Jump to

Keyboard shortcuts

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