Documentation ¶
Index ¶
- Variables
- func ForceRefreshToken(ctx ttnlog.Interface)
- func GetAccount(ctx ttnlog.Interface) *account.Account
- func GetAppEUI(ctx ttnlog.Interface) types.AppEUI
- func GetAppID(ctx ttnlog.Interface) string
- func GetConfigFile() string
- func GetContext(log ttnlog.Interface, extraPairs ...string) context.Context
- func GetDataDir() string
- func GetDiscovery(ctx ttnlog.Interface) (*grpc.ClientConn, discovery.DiscoveryClient)
- func GetGatewayMetadata(id string, freq uint64) *gateway.RxMetadata
- func GetHandlerManager(ctx ttnlog.Interface, appID string) (*grpc.ClientConn, *handler.ManagerClient)
- func GetID() string
- func GetMQTT(ctx ttnlog.Interface, accessKey string) mqtt.Client
- func GetProtocolMetadata(dataRate string) *protocol.RxMetadata
- func GetRouter(ctx ttnlog.Interface) (*grpc.ClientConn, *router.Client)
- func GetRouterManager(ctx ttnlog.Interface) (*grpc.ClientConn, router.RouterManagerClient)
- func GetTokenCache() cache.Cache
- func GetTokenManager(accessToken string) tokens.Manager
- func GetTokenSource(ctx ttnlog.Interface) oauth2.TokenSource
- func GetUserAgent() string
- func IsErrOutOfRange(err error) bool
- func Login(ctx ttnlog.Interface, code string) (*oauth2.Token, error)
- func Logout() error
- func ParseLocation(locationStr string) (*account.Location, error)
- func PrintConfig(ctx ttnlog.Interface, debug bool)
- func ReadFields() (map[string]interface{}, error)
- func ReadInput(reader *bufio.Reader) (string, error)
- func ReadPayload() ([]byte, error)
- func ReadPort() (uint8, error)
- func SetApp(ctx ttnlog.Interface, appID string, appEUI types.AppEUI)
- func SetAppEUI(ctx ttnlog.Interface, appEUI types.AppEUI)
- func TokenForScope(ctx ttnlog.Interface, scope string) string
- type Message
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidPayload = errors.New("Invalid payload (Should be hexadecimal)")
Functions ¶
func ForceRefreshToken ¶
ForceRefreshToken forces a refresh of the access token
func GetAccount ¶
GetAccount gets a new Account server client for ttnctl
func GetConfigFile ¶
func GetConfigFile() string
GetConfigFile returns the location of the configuration file. It checks the following (in this order): the --config flag $XDG_CONFIG_HOME/ttnctl/config.yml (if $XDG_CONFIG_HOME is set) $HOME/.ttnctl.yml
func GetContext ¶
GetContext returns a new context
func GetDataDir ¶
func GetDataDir() string
GetDataDir returns the location of the data directory used for sotring data. It checks the following (in this order): the --data flag $XDG_DATA_HOME/ttnctl (if $XDG_DATA_HOME is set) $XDG_CACHE_HOME/ttnctl (if $XDG_CACHE_HOME is set) $HOME/.ttnctl
func GetDiscovery ¶
func GetDiscovery(ctx ttnlog.Interface) (*grpc.ClientConn, discovery.DiscoveryClient)
GetDiscovery gets the Discovery client for ttnctl
func GetGatewayMetadata ¶
func GetGatewayMetadata(id string, freq uint64) *gateway.RxMetadata
GetGatewayMetadata returns gateway metadata for the given gateway ID and frequency
func GetHandlerManager ¶
func GetHandlerManager(ctx ttnlog.Interface, appID string) (*grpc.ClientConn, *handler.ManagerClient)
GetHandlerManager gets a new HandlerManager for ttnctl
func GetProtocolMetadata ¶
func GetProtocolMetadata(dataRate string) *protocol.RxMetadata
GetProtocolMetadata returns protocol metadata for the given datarate
func GetRouterManager ¶
func GetRouterManager(ctx ttnlog.Interface) (*grpc.ClientConn, router.RouterManagerClient)
GetRouterManager starts a management connection with the router
func GetTokenCache ¶
GetCache get's the cache that will store our tokens
func GetTokenManager ¶
func GetTokenSource ¶
func GetTokenSource(ctx ttnlog.Interface) oauth2.TokenSource
GetTokenSource builds a new oauth2.TokenSource that uses the ttnctl config to store the token
func GetUserAgent ¶
func GetUserAgent() string