Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCommand ¶
NewCommand builds the full CLI command tree for the rFMS SDK.
Types ¶
type Option ¶
type Option func(*config)
Option configures the CLI command tree.
func WithHTTPClient ¶
WithHTTPClient sets the base http.Client passed to the SDK client.
func WithScaniaCredentialStore ¶
func WithScaniaCredentialStore(s ScaniaCredentialStore) Option
WithScaniaCredentialStore sets the credential store for Scania rFMS.
func WithTokenStore ¶
func WithTokenStore(s TokenStore) Option
WithTokenStore sets the token store (used for Scania OAuth2 tokens).
func WithVolvoCredentialStore ¶
func WithVolvoCredentialStore(s VolvoCredentialStore) Option
WithVolvoCredentialStore sets the credential store for Volvo Trucks rFMS.
type ScaniaCredentialStore ¶
type ScaniaCredentialStore interface {
Load() (*ScaniaCredentials, error)
Save(*ScaniaCredentials) error
Clear() error
}
ScaniaCredentialStore reads and writes Scania credentials.
func NewScaniaCredentialFileStore ¶
func NewScaniaCredentialFileStore(path string) ScaniaCredentialStore
NewScaniaCredentialFileStore creates a file-backed Scania credential store.
type ScaniaCredentials ¶
type ScaniaCredentials struct {
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
}
ScaniaCredentials holds Scania rFMS OAuth2 client credentials.
type TokenStore ¶
TokenStore reads and writes OAuth2 tokens.
func NewTokenFileStore ¶
func NewTokenFileStore(path string) TokenStore
NewTokenFileStore creates a file-backed token store.
type VolvoCredentialStore ¶
type VolvoCredentialStore interface {
Load() (*VolvoCredentials, error)
Save(*VolvoCredentials) error
Clear() error
}
VolvoCredentialStore reads and writes Volvo Trucks credentials.
func NewVolvoCredentialFileStore ¶
func NewVolvoCredentialFileStore(path string) VolvoCredentialStore
NewVolvoCredentialFileStore creates a file-backed Volvo credential store.
type VolvoCredentials ¶
type VolvoCredentials struct {
Username string `json:"username"`
Password string `json:"password"`
}
VolvoCredentials holds Volvo Trucks rFMS HTTP Basic credentials.