Documentation
¶
Index ¶
- Constants
- type CommandHandler
- type Config
- type Connector
- func (this *Connector) CheckEndpointAuth(token JwtToken, endpoint string) (err error)
- func (this *Connector) GetOpenidPasswordToken(username, password string) (token OpenidToken, err error)
- func (this *Connector) GetUserToken(username string) (token JwtToken, err error)
- func (this *Connector) HandleEvent(username string, password string, endpoint string, ...) (total int, success int, ignore int, fail int, err error)
- func (this *Connector) HandleEventWithAuthToken(token JwtToken, endpoint string, protocolParts map[string]string) (total int, success int, ignore int, fail int, err error)
- func (this *Connector) Stop()
- type Endpoint
- type EndpointGenMsg
- type EndpointGenMsgPart
- type Envelope
- type JwtToken
- func (this JwtToken) Get(url string) (resp *http.Response, err error)
- func (this JwtToken) GetJSON(url string, result interface{}) (err error)
- func (this JwtToken) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (this JwtToken) PostJSON(url string, body interface{}, result interface{}) (err error)
- type KeycloakClaims
- type OpenidToken
- type ProtocolMsg
- type ProtocolPart
- type RealmAccess
- type RoleMapping
- type RunnerHandlerFunc
- type RunnerTask
- type StopCheckFunc
- type UserRepresentation
Constants ¶
View Source
const SENSOR_TYPE = "http://www.sepl.wifa.uni-leipzig.de/ontlogies/device-repo#Sensor"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandHandler ¶
type Config ¶
type Config struct {
ZookeeperUrl string //host1:2181,host2:2181/chroot
KafkaResponseTopic string
KafkaEventTopic string
Protocol string
FatalKafkaErrors string
KafkaTimeout int64
SaramaLog string
IotRepoUrl string
LogProduce string //"true"
AuthClientId string //keycloak-client
AuthClientSecret string //keycloak-secret
AuthExpirationTimeBuffer float64
AuthEndpoint string
JwtPrivateKey string
JwtExpiration int64
JwtIssuer string
}
func LoadConfig ¶
loads config from json in location and used environment variables (e.g ZookeeperUrl --> ZOOKEEPER_URL)
type Connector ¶
type Connector struct {
Config Config
CommandHandler CommandHandler //must be able to handle concurrent calls
// contains filtered or unexported fields
}
func Init ¶
func Init(config Config, commandHandler CommandHandler) (connector *Connector)
func (*Connector) CheckEndpointAuth ¶
func (*Connector) GetOpenidPasswordToken ¶
func (this *Connector) GetOpenidPasswordToken(username, password string) (token OpenidToken, err error)
func (*Connector) GetUserToken ¶
func (*Connector) HandleEvent ¶
type EndpointGenMsg ¶
type EndpointGenMsg struct {
Endpoint string `json:"endpoint"`
ProtocolHandler string `json:"protocol_handler"`
Parts []EndpointGenMsgPart `json:"parts"`
}
type EndpointGenMsgPart ¶
type KeycloakClaims ¶
type KeycloakClaims struct {
RealmAccess RealmAccess `json:"realm_access"`
jwt.StandardClaims
}
type OpenidToken ¶
type OpenidToken struct {
AccessToken string `json:"access_token"`
ExpiresIn float64 `json:"expires_in"`
RefreshExpiresIn float64 `json:"refresh_expires_in"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
RequestTime time.Time `json:"-"`
}
func (*OpenidToken) JwtToken ¶
func (this *OpenidToken) JwtToken() JwtToken
type ProtocolMsg ¶
type ProtocolMsg struct {
WorkerId string `json:"worker_id"`
TaskId string `json:"task_id"`
DeviceUrl string `json:"device_url"`
ServiceUrl string `json:"service_url"`
ProtocolParts []ProtocolPart `json:"protocol_parts"`
DeviceInstanceId string `json:"device_instance_id"`
ServiceId string `json:"service_id"`
OutputName string `json:"output_name"`
Time string `json:"time"`
Service model.Service `json:"service"`
}
type ProtocolPart ¶
type RealmAccess ¶
type RealmAccess struct {
Roles []string `json:"roles"`
}
type RoleMapping ¶
type RoleMapping struct {
Name string `json:"name"`
}
type RunnerHandlerFunc ¶
type RunnerHandlerFunc func(StopCheckFunc) error
type RunnerTask ¶
type RunnerTask struct {
// contains filtered or unexported fields
}
func RunTask ¶
func RunTask(handler RunnerHandlerFunc) (task *RunnerTask)
func (*RunnerTask) Stop ¶
func (t *RunnerTask) Stop()
type StopCheckFunc ¶
type StopCheckFunc func() bool
type UserRepresentation ¶
Click to show internal directories.
Click to hide internal directories.