addressbook

package
v0.80.1 Latest Latest
Warning

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

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

Documentation

Overview

Package addressbook provides CLI commands for address book management operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(cfg Config) (*cobra.Command, error)

NewCommand creates a new address-book command with all subcommands.

Types

type AddressBookMergerFunc

type AddressBookMergerFunc func(envDir domain.EnvDir, name, timestamp string) error

AddressBookMergerFunc merges a changeset's address book to the main address book.

type AddressBookMigratorFunc

type AddressBookMigratorFunc func(envDir domain.EnvDir) error

AddressBookMigratorFunc migrates the address book to the new datastore format.

type AddressBookRemoverFunc

type AddressBookRemoverFunc func(envDir domain.EnvDir, name, timestamp string) error

AddressBookRemoverFunc removes a changeset's address book entries from the main address book.

type Config

type Config struct {
	// Logger is the logger to use for command output. Required.
	Logger logger.Logger

	// Domain is the domain context for the commands. Required.
	Domain domain.Domain

	// Deps holds optional dependencies that can be overridden.
	// If fields are nil, production defaults are used.
	Deps Deps
}

Config holds the configuration for addressbook commands.

func (Config) Validate

func (c Config) Validate() error

Validate checks that all required configuration fields are set.

type Deps

type Deps struct {
	// AddressBookMerger merges a changeset's address book to the main address book.
	// Default: envDir.MergeChangesetAddressBook
	AddressBookMerger AddressBookMergerFunc

	// AddressBookMigrator migrates the address book to the new datastore format.
	// Default: envDir.MigrateAddressBook
	AddressBookMigrator AddressBookMigratorFunc

	// AddressBookRemover removes a changeset's address book entries.
	// Default: envDir.RemoveChangesetAddressBook
	AddressBookRemover AddressBookRemoverFunc
}

Deps holds the injectable dependencies for addressbook commands. All fields are optional; nil values will use production defaults.

Jump to

Keyboard shortcuts

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