cli

package module
v0.0.0-...-0562a48 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT Imports: 16 Imported by: 0

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 rFMS SDK.

Types

type Option

type Option func(*config)

Option configures the CLI command tree.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

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

type TokenStore interface {
	Load() (*oauth2.Token, error)
	Save(*oauth2.Token) error
	Clear() error
}

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.

Jump to

Keyboard shortcuts

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