Documentation ¶
Index ¶
Constants ¶
View Source
const EnvPrefix = "bridge"
EnvPrefix is the environment prefix that is used for configuration
Variables ¶
View Source
var BridgeCmd = &cobra.Command{ Use: "gateway-connector-bridge", Short: "The Things Network's Gateway Connector bridge", Long: `gateway-connector-bridge bridges between Gateway Connector and gRPC`, PersistentPreRun: func(cmd *cobra.Command, args []string) { var logHandlers []log.Handler logHandlers = append(logHandlers, cli.New(os.Stdout)) if logFileLocation := config.GetString("log-file"); logFileLocation != "" { absLogFileLocation, err := filepath.Abs(logFileLocation) if err != nil { panic(err) } logFile, err = os.OpenFile(absLogFileLocation, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644) if err != nil { panic(err) } if err == nil { logHandlers = append(logHandlers, json.New(logFile)) } } logLevel := log.InfoLevel if config.GetBool("debug") { logLevel = log.DebugLevel } ctx = &log.Logger{ Level: logLevel, Handler: multi.New(logHandlers...), } ttnlog.Set(apex.Wrap(ctx)) }, Run: runBridge, PersistentPostRun: func(cmd *cobra.Command, args []string) { if logFile != nil { time.Sleep(100 * time.Millisecond) logFile.Close() } }, }
BridgeCmd is the main command that is executed when running gateway-connector-bridge
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.