Documentation
¶
Index ¶
- type ErrFunc
- type OwnerCache
- func (c *OwnerCache) Close()
- func (c *OwnerCache) GetDevices(ctx context.Context) (devices []string, err error)
- func (c *OwnerCache) GetSelectedDevices(ctx context.Context, devices []string) ([]string, error)
- func (c *OwnerCache) OwnerClaim() string
- func (c *OwnerCache) OwnsDevice(ctx context.Context, deviceID string) (bool, error)
- func (c *OwnerCache) OwnsDevices(ctx context.Context, devices []string) (bool, error)
- func (c *OwnerCache) Subscribe(owner string, onEvent func(e *events.Event)) (func(), error)
- func (c *OwnerCache) Update(ctx context.Context) (added []string, removed []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OwnerCache ¶
type OwnerCache struct {
// contains filtered or unexported fields
}
func NewOwnerCache ¶
func NewOwnerCache(ownerClaim string, expiration time.Duration, conn *nats.Conn, isClient pbIS.IdentityStoreClient, errFunc ErrFunc) *OwnerCache
func (*OwnerCache) Close ¶
func (c *OwnerCache) Close()
func (*OwnerCache) GetDevices ¶
func (c *OwnerCache) GetDevices(ctx context.Context) (devices []string, err error)
GetDevices provides the owner of the cached device. If the cache does not expire, the cache expiration is extended.
func (*OwnerCache) GetSelectedDevices ¶
Check provided list of device ids and return only ids owned by the user
func (*OwnerCache) OwnerClaim ¶
func (c *OwnerCache) OwnerClaim() string
func (*OwnerCache) OwnsDevice ¶
Convenience method to check if given device is owned by the user
func (*OwnerCache) OwnsDevices ¶
Check if all provided devices are owned by the user
Click to show internal directories.
Click to hide internal directories.