Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
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 ¶
WithHTTPClient sets a custom HTTP client for the SDK.
Click to show internal directories.
Click to hide internal directories.