Documentation ¶
Index ¶
- type FactoryInterface
- type FactoryType
- type Impersonate
- func (this Impersonate) Get(url string) (resp *http.Response, err error)
- func (this Impersonate) GetJSON(url string, result interface{}) (err error)
- func (this Impersonate) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (this Impersonate) PostJSON(url string, body interface{}, result interface{}) (err error)
- type Iot
- func (this *Iot) GetDevice(token Impersonate, id string) (result model.Device, err error)
- func (this *Iot) GetDeviceGroup(token Impersonate, id string) (result model.DeviceGroup, err error)
- func (this *Iot) GetDeviceType(token Impersonate, id string) (result model.DeviceType, err error)
- func (this *Iot) GetProtocol(token Impersonate, id string) (result model.Protocol, err error)
- func (this *Iot) GetService(token Impersonate, device model.Device, id string) (result model.Service, err error)
- func (this *Iot) GetToken(user string) (result Impersonate, err error)
- type Keycloak
- type KeycloakClaims
- type OpenidToken
- type RealmAccess
- type RepoInterface
- type RoleMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FactoryInterface ¶
type FactoryInterface interface {
Get(configType util.Config) (RepoInterface, error)
}
type FactoryType ¶
type FactoryType struct{}
var Factory FactoryType
func (FactoryType) Get ¶
func (FactoryType) Get(config util.Config) (RepoInterface, error)
type Impersonate ¶
type Impersonate string
func EnsureAccess ¶
func EnsureAccess(config util.Config) (token Impersonate, err error)
func (Impersonate) GetJSON ¶
func (this Impersonate) GetJSON(url string, result interface{}) (err error)
func (Impersonate) PostJSON ¶
func (this Impersonate) PostJSON(url string, body interface{}, result interface{}) (err error)
type Iot ¶
type Iot struct {
// contains filtered or unexported fields
}
func (*Iot) GetDeviceGroup ¶
func (this *Iot) GetDeviceGroup(token Impersonate, id string) (result model.DeviceGroup, err error)
func (*Iot) GetDeviceType ¶
func (this *Iot) GetDeviceType(token Impersonate, id string) (result model.DeviceType, err error)
func (*Iot) GetProtocol ¶
func (*Iot) GetService ¶
type Keycloak ¶
type Keycloak struct {
// contains filtered or unexported fields
}
func (Keycloak) ForgeUserToken ¶
func (this Keycloak) ForgeUserToken(user string) (token Impersonate, err error)
func (Keycloak) GetUserToken ¶
func (this Keycloak) GetUserToken(userid string) (token Impersonate, expirationInSec float64, err error)
type KeycloakClaims ¶
type KeycloakClaims struct { RealmAccess RealmAccess `json:"realm_access"` jwt.StandardClaims }
type OpenidToken ¶
type RealmAccess ¶
type RealmAccess struct {
Roles []string `json:"roles"`
}
type RepoInterface ¶
type RepoInterface interface { GetDevice(token Impersonate, id string) (model.Device, error) GetService(token Impersonate, device model.Device, serviceId string) (model.Service, error) GetProtocol(token Impersonate, id string) (model.Protocol, error) GetToken(user string) (Impersonate, error) GetDeviceType(token Impersonate, id string) (model.DeviceType, error) GetDeviceGroup(token Impersonate, id string) (model.DeviceGroup, error) }
type RoleMapping ¶
type RoleMapping struct {
Name string `json:"name"`
}
Click to show internal directories.
Click to hide internal directories.