Documentation ¶
Index ¶
- type Config
- type PersistenceTx
- func (p *PersistenceTx) Close()
- func (p *PersistenceTx) Delete(deviceID, userID string) error
- func (p *PersistenceTx) Persist(d *persistence.AuthorizedDevice) error
- func (p *PersistenceTx) Retrieve(deviceID, userID string) (_ *persistence.AuthorizedDevice, ok bool, err error)
- func (p *PersistenceTx) RetrieveByDevice(deviceID string) (_ *persistence.AuthorizedDevice, ok bool, err error)
- func (p *PersistenceTx) RetrieveByOwner(owner string) persistence.Iterator
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PersistenceTx ¶
type PersistenceTx struct {
// contains filtered or unexported fields
}
PersistenceTx prevents data race for a sequence of read and write operations.
func (*PersistenceTx) Close ¶
func (p *PersistenceTx) Close()
Close must always be called (use defer immediately after NewTransaction).
func (*PersistenceTx) Delete ¶
func (p *PersistenceTx) Delete(deviceID, userID string) error
Delete removes the device's authorization record.
func (*PersistenceTx) Persist ¶
func (p *PersistenceTx) Persist(d *persistence.AuthorizedDevice) error
Persist device's authorization details.
func (*PersistenceTx) Retrieve ¶
func (p *PersistenceTx) Retrieve(deviceID, userID string) (_ *persistence.AuthorizedDevice, ok bool, err error)
Retrieve device's authorization details.
func (*PersistenceTx) RetrieveByDevice ¶
func (p *PersistenceTx) RetrieveByDevice(deviceID string) (_ *persistence.AuthorizedDevice, ok bool, err error)
RetrieveByDevice device's authorization details.
func (*PersistenceTx) RetrieveByOwner ¶
func (p *PersistenceTx) RetrieveByOwner(owner string) persistence.Iterator
RetrieveAll retrieves all owner's authorized devices.
type Store ¶
func (*Store) NewTransaction ¶
func (p *Store) NewTransaction(ctx context.Context) persistence.PersistenceTx
NewTransaction creates a new transaction. A transaction must always be closed:
tx := s.persistence.NewTransaction() defer tx.Close()
Click to show internal directories.
Click to hide internal directories.