cmd

package
v0.0.0-...-96f310c Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRedirectStdout = errors.New("stdout unredirected")
	ErrInvalidFormat  = errors.New("invalid format: supply mcap0, bag1, or json")
)
View Source
var ErrInvalidInput = errors.New("magic bytes do not match bag or mcap format")
View Source
var ErrTruncatedMCAP = errors.New("truncated mcap file")

Functions

func AddDeviceAutocompletion

func AddDeviceAutocompletion(cmd *cobra.Command, params *baseParams)

AddDeviceAutocompletion adds autocompletion for device-name and device-id parameters to the command.

func AddFormatFlag

func AddFormatFlag(cmd *cobra.Command, format *string)

Define a `format` flag on a command for one of the formats above

func AddJsonFlag

func AddJsonFlag(cmd *cobra.Command, isJsonFormat *bool)

func Execute

func Execute(version string)

func IsAuthenticated

func IsAuthenticated() bool

func ResolveFormat

func ResolveFormat(formatFlagValue string, jsonFlagValue bool) string

Ensure --json alias is not conflicting with --format's value

func TokenIsApiKey

func TokenIsApiKey(token string) bool

Types

type AuthType

type AuthType int
const (
	Unknown AuthType = iota
	TokenSession
	TokenApiKey
)

type DecimalTime

type DecimalTime uint64

func (DecimalTime) MarshalJSON

func (t DecimalTime) MarshalJSON() ([]byte, error)

func (*DecimalTime) UnmarshalJSON

func (t *DecimalTime) UnmarshalJSON(b []byte) error

type Message

type Message struct {
	Topic       string          `json:"topic"`
	Sequence    uint32          `json:"sequence"`
	LogTime     DecimalTime     `json:"log_time"`
	PublishTime DecimalTime     `json:"publish_time"`
	Data        json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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