cli

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: MIT Imports: 17 Imported by: 0 modules, 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

View Source
var ErrServiceUnconfigured = errors.New("Pushman API transport is not configured in this scaffold")

Functions

func ExitCode

func ExitCode(err error) int

func IsTerminalFile

func IsTerminalFile(file *os.File) func() bool

func New

func New(deps Dependencies) *cobra.Command

Types

type AuthorizationError

type AuthorizationError struct{ Err error }

func (*AuthorizationError) Error

func (e *AuthorizationError) Error() string

func (*AuthorizationError) Unwrap

func (e *AuthorizationError) Unwrap() error

type Dependencies

type Dependencies struct {
	In          io.Reader
	Out         io.Writer
	ErrOut      io.Writer
	IsTerminal  func() bool
	Hostname    func() (string, error)
	OpenBrowser func(string) error
	SelfUpdate  func(context.Context) (string, error)
	Service     Service
	Version     VersionInfo
}

type Device

type Device struct {
	Nickname string
	Status   string
}

type DoctorCheck

type DoctorCheck struct {
	Name    string
	OK      bool
	Message string
}

type HistoryDelivery

type HistoryDelivery struct {
	DeviceName string
	State      string
	Failure    string
}

type HistoryDetail

type HistoryDetail struct {
	LogicalMessageID string
	Read             bool
	Revisions        []HistoryRevision
}

type HistoryItem

type HistoryItem struct {
	ID            string
	Title         string
	UpdatedAt     time.Time
	UpdateCount   int
	DeliveryState string
}

type HistoryRevision

type HistoryRevision struct {
	ID         string
	Title      string
	Subtitle   string
	Body       string
	SenderName string
	URL        string
	Image      string
	Sound      string
	Format     string
	UpdatedAt  time.Time
	Deliveries []HistoryDelivery
}

type LoginChallenge

type LoginChallenge struct {
	UserCode        string
	VerificationURL string
	CompleteURL     string
	ExpiresIn       time.Duration
}

type LoginRequest

type LoginRequest struct {
	Platform      string
	SuggestedName string
	OnChallenge   func(LoginChallenge) error
}

type PairChallenge

type PairChallenge struct {
	UserCode        string
	VerificationURL string
	ExpiresAt       time.Time
}

type PairRequest

type PairRequest struct {
	Platform      string
	SuggestedName string
	OnChallenge   func(PairChallenge) error
}

type PairResult

type PairResult struct {
	Nickname string
}

type PushRequest

type PushRequest struct {
	Body     string   `json:"body"`
	Title    string   `json:"title,omitempty"`
	Subtitle string   `json:"subtitle,omitempty"`
	URL      string   `json:"url,omitempty"`
	Group    string   `json:"group,omitempty"`
	Image    string   `json:"image,omitempty"`
	Sound    string   `json:"sound"`
	Key      string   `json:"key,omitempty"`
	Format   string   `json:"format"`
	Devices  []string `json:"devices,omitempty"`
}

type PushResult

type PushResult struct {
	ID          string    `json:"id"`
	Status      string    `json:"status"`
	DeviceCount int       `json:"deviceCount"`
	AcceptedAt  time.Time `json:"acceptedAt"`
}

type Service

Service is the command-facing boundary for the future generated API client and credential store. Its concrete HTTP implementation follows the shared OpenAPI contract.

type ServiceError

type ServiceError struct {
	Code       string
	Message    string
	RetryAfter int
}

func (*ServiceError) Error

func (e *ServiceError) Error() string

type StatusResult

type StatusResult struct {
	Paired   bool
	Nickname string
	Method   string
}

type UnconfiguredService

type UnconfiguredService struct{}

func (UnconfiguredService) Devices

func (UnconfiguredService) Doctor

func (UnconfiguredService) History

func (UnconfiguredService) HistoryShow

func (UnconfiguredService) Login

func (UnconfiguredService) Logout

func (UnconfiguredService) Pair

func (UnconfiguredService) Push

func (UnconfiguredService) Rename

func (UnconfiguredService) Status

func (UnconfiguredService) Usage

type UsageError

type UsageError struct{ Err error }

func (*UsageError) Error

func (e *UsageError) Error() string

func (*UsageError) Unwrap

func (e *UsageError) Unwrap() error

type UsageResult

type UsageResult struct {
	Used         int
	Limit        int
	ResetsAt     time.Time
	Plan         string
	BillingState string
}

type VersionInfo

type VersionInfo struct {
	Version string
	Commit  string
	Date    string
}

Jump to

Keyboard shortcuts

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