api

package
v0.0.0-...-db6b00a Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIErrorDeviceNotFound = 1
	APIErrorBodyParsing    = 2
	APIErrorDatabase       = 3
	APIErrorInvalidValue   = 4
	APIErrorUnauthorized   = 5
	APIErrorExpiredToken   = 6

	TokenName           = "EiPAccessToken"
	TokenExpirationTime = 86400 // in seconds: 1day
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	EventsToBackend chan map[string]interface{}
	// contains filtered or unexported fields
}

func InitAPI

func InitAPI(db database.Database, conf pkg.ServiceConfig) *API

InitAPI start API connection

type APIError

type APIError struct {
	Code    int    `json:"code"` //errorCode
	Message string `json:"message"`
}

APIError Message error code

type APIFunctions

type APIFunctions struct {
	Functions []string `json:"functions"`
}

type APIInfo

type APIInfo struct {
	Versions []string `json:"versions"`
}

type Claims

type Claims struct {
	Username string `json:"username"`
	jwt.StandardClaims
}

type Credentials

type Credentials struct {
	Password string `json:"password"`
	Username string `json:"username"`
}

type InternalAPI

type InternalAPI struct {
	EventsToBackend chan map[string]interface{}
	// contains filtered or unexported fields
}

func InitInternalAPI

func InitInternalAPI(db database.Database, conf pkg.ServiceConfig) *InternalAPI

InitInternalAPI start API connection

type JwtToken

type JwtToken struct {
	Token     string `json:"accessToken"`
	TokenType string `json:"tokenType"`
	ExpireIn  int    `json:"expireIn"`
}

Jump to

Keyboard shortcuts

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