devicerepository

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

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) Get

func (this Impersonate) Get(url string) (resp *http.Response, err error)

func (Impersonate) GetJSON

func (this Impersonate) GetJSON(url string, result interface{}) (err error)

func (Impersonate) Post

func (this Impersonate) Post(url string, contentType string, body io.Reader) (resp *http.Response, 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 NewIot

func NewIot(config util.Config) (*Iot, error)

func (*Iot) GetDevice

func (this *Iot) GetDevice(token Impersonate, id string) (result model.Device, err error)

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 (this *Iot) GetProtocol(token Impersonate, id string) (result model.Protocol, err error)

func (*Iot) GetService

func (this *Iot) GetService(token Impersonate, device model.Device, id string) (result model.Service, err error)

func (*Iot) GetToken

func (this *Iot) GetToken(user string) (result Impersonate, err error)

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 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:"-"`
}

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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