Documentation ¶
Overview ¶
Package commands implements the commands for the ttn-lw-cli binary.
Index ¶
- Variables
- func AddCollaboratorFlagAlias(flagSet *pflag.FlagSet, prefix string)
- func AddGatewayAntennaIdentifierFlags(flagSet *pflag.FlagSet, prefix string)
- func GetClassBCGatewayIdentifiers(flagSet *pflag.FlagSet, prefix string) (identifiers []*ttnpb.ClassBCGatewayIdentifiers, err error)
- type Config
- type RetryConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = MakeDefaultConfig(defaultGRPCAddress, defaultOAuthServerAddress, defaultInsecure)
DefaultConfig contains the default config for the ttn-lw-cli binary.
View Source
var ( // Root command is the entrypoint of the program Root = &cobra.Command{ Use: name, SilenceErrors: true, SilenceUsage: true, Short: "The Things Network Command-line Interface", PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if cmd.Name() == "__complete" { return nil } return preRun(checkAuth, refreshToken, requireAuth)(cmd, args) }, PersistentPostRunE: func(cmd *cobra.Command, args []string) error { if cmd.Name() == "__complete" { return nil } api.CloseAll() select { case <-ctx.Done(): case <-time.After(versionCheckTimeout): logger.Warn("Version check timed out") case versionUpdate, ok := <-versionUpdate: if ok { pkgversion.LogUpdate(ctx, versionUpdate) } } select { case <-ctx.Done(): case <-time.After(telemetryTimeout): logger.Warn("Telemetry submission timed out") case <-telemetrySubmission: } err := util.SaveAuthCache(cache) if err != nil { return err } return ctx.Err() }, } )
Functions ¶
func AddCollaboratorFlagAlias ¶ added in v3.19.1
AddCollaboratorFlagAlias adds alias for user id and organization id in User
func AddGatewayAntennaIdentifierFlags ¶ added in v3.19.1
AddGatewayAntennaIdentifierFlags adds a string slice flag for gateway antennas.
func GetClassBCGatewayIdentifiers ¶ added in v3.28.0
func GetClassBCGatewayIdentifiers(flagSet *pflag.FlagSet, prefix string) (identifiers []*ttnpb.ClassBCGatewayIdentifiers, err error)
GetClassBCGatewayIdentifiers gets a string slice value from a flag and returns a slice of class B/C gateway identifiers.
Types ¶
type Config ¶
type Config struct { conf.Base `name:",squash"` CredentialsID string `name:"credentials-id" yaml:"credentials-id" description:"Credentials ID (if using multiple configurations)"` //nolint:lll InputFormat string `name:"input-format" yaml:"input-format" description:"Input format"` //nolint:lll OutputFormat string `name:"output-format" yaml:"output-format" description:"Output format"` //nolint:lll AllowUnknownHosts bool `name:"allow-unknown-hosts" yaml:"allow-unknown-hosts" description:"Allow sending credentials to unknown hosts"` //nolint:lll OAuthServerAddress string `name:"oauth-server-address" yaml:"oauth-server-address" description:"OAuth Server address"` //nolint:lll IdentityServerGRPCAddress string `name:"identity-server-grpc-address" yaml:"identity-server-grpc-address" description:"Identity Server address"` //nolint:lll GatewayServerEnabled bool `name:"gateway-server-enabled" yaml:"gateway-server-enabled" description:"Gateway Server enabled"` //nolint:lll GatewayServerGRPCAddress string `name:"gateway-server-grpc-address" yaml:"gateway-server-grpc-address" description:"Gateway Server address"` //nolint:lll NetworkServerEnabled bool `name:"network-server-enabled" yaml:"network-server-enabled" description:"Network Server enabled"` //nolint:lll NetworkServerGRPCAddress string `name:"network-server-grpc-address" yaml:"network-server-grpc-address" description:"Network Server address"` //nolint:lll ApplicationServerEnabled bool `name:"application-server-enabled" yaml:"application-server-enabled" description:"Application Server enabled"` //nolint:lll ApplicationServerGRPCAddress string `name:"application-server-grpc-address" yaml:"application-server-grpc-address" description:"Application Server address"` //nolint:lll JoinServerEnabled bool `name:"join-server-enabled" yaml:"join-server-enabled" description:"Join Server enabled"` //nolint:lll JoinServerGRPCAddress string `name:"join-server-grpc-address" yaml:"join-server-grpc-address" description:"Join Server address"` //nolint:lll DeviceTemplateConverterGRPCAddress string `` //nolint:lll /* 139-byte string literal not displayed */ DeviceClaimingServerGRPCAddress string `` //nolint:lll /* 130-byte string literal not displayed */ QRCodeGeneratorGRPCAddress string `name:"qr-code-generator-grpc-address" yaml:"qr-code-generator-grpc-address" description:"QR Code Generator address"` //nolint:lll PacketBrokerAgentGRPCAddress string `name:"packet-broker-agent-grpc-address" yaml:"packet-broker-agent-grpc-address" description:"Packet Broker Agent address"` //nolint:lll Insecure bool `name:"insecure" yaml:"insecure" description:"Connect without TLS"` //nolint:lll CA string `name:"ca" yaml:"ca" description:"CA certificate file"` DumpRequests bool `name:"dump-requests" yaml:"dump-requests" description:"When log level is set to debug, also dump request payload as JSON"` //nolint:lll SkipVersionCheck bool `name:"skip-version-check" yaml:"skip-version-check" description:"Do not perform version checks"` //nolint:lll Retry RetryConfig `name:"retry" yaml:"retry"` Telemetry telemetry.CLI `name:"telemetry" yaml:"telemetry" description:"Telemetry configuration"` //nolint:lll }
Config for the ttn-lw-cli binary.
type RetryConfig ¶ added in v3.17.2
type RetryConfig struct { Max uint `name:"max" yaml:"max" description:"Maximum amount of times that a request can be reattempted"` //nolint:lll DefaultTimeout time.Duration `name:"default-timeout" yaml:"default-timeout" description:"Default timeout between retry attempts"` //nolint:lll EnableMetadata bool `` //nolint:lll /* 145-byte string literal not displayed */ Jitter float64 `name:"jitter" yaml:"jitter" description:"Fraction that creates a deviation of the timeout used between retry attempts"` //nolint:lll }
RetryConfig defines the values for the retry behavior in the CLI.
Source Files ¶
- access.go
- applications.go
- applications_access.go
- applications_activation_settings.go
- applications_claim.go
- applications_downlink.go
- applications_link.go
- applications_packages.go
- applications_pubsub.go
- applications_subscribe.go
- applications_webhooks.go
- bulk.go
- clients.go
- clients_access.go
- config.go
- contact_info.go
- context.go
- end_device_templates.go
- end_devices.go
- end_devices_split.go
- events.go
- flags.go
- gateways.go
- gateways_access.go
- gateways_claim.go
- login.go
- lorawan.go
- messages.go
- notifications.go
- organizations.go
- organizations_access.go
- packetbroker.go
- pagination.go
- picture.go
- relays.go
- root.go
- simulate.go
- storage_integration.go
- storage_integration_util.go
- use.go
- users.go
- users_access.go
- users_bookmarks.go
- users_email_validation.go
- users_invitations.go
- users_oauth.go
- users_sessions.go
- utils.go
Click to show internal directories.
Click to hide internal directories.