cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCommand

func NewRootCommand(deps Dependencies) *cobra.Command

Types

type APIClient

type APIClient interface {
	ListRecords(ctx context.Context, domain, recordType string) ([]api.Record, error)
	CreateRecord(ctx context.Context, domain string, input api.RecordInput) (*api.Record, error)
	UpdateRecord(ctx context.Context, domain, id string, input api.RecordInput) (*api.Record, error)
	DeleteRecord(ctx context.Context, domain, id string) (*api.Record, error)
	ListMailboxes(ctx context.Context, domain string) ([]api.Mailbox, error)
	ListForwardings(ctx context.Context, domain string) ([]api.Forwarding, error)
	GetSecrets(ctx context.Context, project, env, deployment, format string) (*api.SecretsResult, error)
}

APIClient is the subset of *api.Client the domain, mailbox, forwarding, and (in a later task) project commands depend on. Tests inject a fake implementation; production code resolves a real *api.Client lazily.

type Dependencies

type Dependencies struct {
	Out, Err   io.Writer
	Store      credentials.Store
	Env        func(string) string
	ReadSecret func(prompt string) (string, error)

	// API, when set, is used instead of resolving a real *api.Client from
	// stored credentials. Left nil in production so credential resolution
	// stays lazy: it happens inside each domain/mailbox/forwarding
	// command's RunE (see resolveAPI in domain.go), never here, so that
	// credential-free commands like "auth login" keep working with zero
	// stored credentials.
	API APIClient
	// BaseURL is the Dymmer API base URL; defaults to
	// "https://dymmer.com/api/v1" when empty.
	BaseURL string
	// IsTerminal reports whether stdin is an interactive terminal; used to
	// decide whether a destructive command may prompt for confirmation.
	IsTerminal func() bool
	// Confirm prompts the user with a yes/no question and reports the
	// answer. It defaults to a real stderr/stdin prompt (internal/confirm).
	Confirm func(prompt string) (bool, error)
}

Jump to

Keyboard shortcuts

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