cli

package module
v0.0.0-...-2c23d6a Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 22 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 Mercedes-Benz SDK.

Types

type FleetCredentialStore

type FleetCredentialStore interface {
	Load() (*FleetCredentials, error)
	Save(*FleetCredentials) error
	Clear() error
}

FleetCredentialStore reads and writes fleet credentials.

func NewFleetCredentialFileStore

func NewFleetCredentialFileStore(path string) FleetCredentialStore

NewFleetCredentialFileStore creates a file-backed store for fleet credentials.

type FleetCredentials

type FleetCredentials struct {
	ClientID           string `json:"clientId"`
	ClientSecret       string `json:"clientSecret"`
	Region             string `json:"region"`
	KafkaConsumerGroup string `json:"kafkaConsumerGroup"`
	KafkaInputTopic    string `json:"kafkaInputTopic"`
}

FleetCredentials holds Mercedes-Benz Fleet API credentials (OAuth2 + Kafka).

type Option

type Option func(*config)

Option configures the CLI command tree.

func WithFleetCredentialStore

func WithFleetCredentialStore(s FleetCredentialStore) Option

WithFleetCredentialStore sets the credential store for Mercedes-Benz Fleet API (OAuth2 + Kafka).

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) Option

WithHTTPClient sets a custom http.Client for the SDK client.

func WithTokenStore

func WithTokenStore(s TokenStore) Option

WithTokenStore sets the token store.

func WithVehicleSpecCredentialStore

func WithVehicleSpecCredentialStore(s VehicleSpecCredentialStore) Option

WithVehicleSpecCredentialStore sets the credential store for Mercedes-Benz Vehicle Specification API.

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 VehicleSpecCredentialStore

type VehicleSpecCredentialStore interface {
	Load() (*VehicleSpecCredentials, error)
	Save(*VehicleSpecCredentials) error
	Clear() error
}

VehicleSpecCredentialStore reads and writes vehicle specification credentials.

func NewVehicleSpecCredentialFileStore

func NewVehicleSpecCredentialFileStore(path string) VehicleSpecCredentialStore

NewVehicleSpecCredentialFileStore creates a file-backed store for vehicle spec credentials.

type VehicleSpecCredentials

type VehicleSpecCredentials struct {
	APIKey string `json:"apiKey"`
}

VehicleSpecCredentials holds Mercedes-Benz Vehicle Specification API credentials.

Jump to

Keyboard shortcuts

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