cli

package module
v0.0.0-...-5e62afc Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(opts ...Option) *cobra.Command

NewCommand builds the full CLI command tree for the TrustTrack SDK.

Types

type CredentialFileStore

type CredentialFileStore struct {
	// contains filtered or unexported fields
}

CredentialFileStore is a JSON file-backed credential store.

func NewCredentialFileStore

func NewCredentialFileStore(path string) *CredentialFileStore

NewCredentialFileStore creates a new file-backed credential store at the given path.

func (*CredentialFileStore) Clear

func (s *CredentialFileStore) Clear() error

Clear removes the credential file.

func (*CredentialFileStore) Load

func (s *CredentialFileStore) Load() (*Credentials, error)

Load reads credentials from the file.

func (*CredentialFileStore) Save

func (s *CredentialFileStore) Save(creds *Credentials) error

Save writes credentials to the file.

type CredentialStore

type CredentialStore interface {
	Load() (*Credentials, error)
	Save(*Credentials) error
	Clear() error
}

CredentialStore loads, saves, and clears credentials.

type Credentials

type Credentials struct {
	APIKey string `json:"api_key"`
}

Credentials holds API credentials for the TrustTrack API.

type Option

type Option func(*config)

Option configures the CLI command tree.

func WithCredentialStore

func WithCredentialStore(s CredentialStore) Option

WithCredentialStore sets the credential store.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets a custom HTTP client for the SDK.

Jump to

Keyboard shortcuts

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