Documentation ¶
Index ¶
- Variables
- func ConnectMQTTClient(ctx log.Interface) mqtt.Client
- func GetAppEUI(ctx log.Interface) types.AppEUI
- func GetHandlerManager(ctx log.Interface) core.AuthHandlerClient
- func Logout(server string) error
- func NewRequestWithAuth(server, method, urlStr string, body io.Reader) (*http.Request, error)
- func ParseHEX(input string, length int) ([]byte, error)
- type App
- type Auth
Constants ¶
This section is empty.
Variables ¶
View Source
var AuthsFileName string
AuthsFileName is where the authentication tokens are stored. Defaults to $HOME/.ttnctl/auths.json
Functions ¶
func ConnectMQTTClient ¶
ConnectMQTTClient connects a new MQTT clients with the specified credentials
func GetHandlerManager ¶
func GetHandlerManager(ctx log.Interface) core.AuthHandlerClient
func NewRequestWithAuth ¶
NewRequestWithAuth creates a new HTTP request and adds the access token of the authenticated user as bearer token
Types ¶
type App ¶
type Auth ¶
type Auth struct { AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` Email string `json:"email"` Expires time.Time `json:"expires"` }
Auth represents an authentication token
func LoadAuth ¶
LoadAuth loads the authentication token for the specified server and attempts to refresh the token if it has been expired
func RefreshToken ¶
RefreshToken refreshes the current token
Click to show internal directories.
Click to hide internal directories.