Documentation ¶
Index ¶
- type Config
- type IdentityAndID
- type Installation
- type Persistence
- type SQLLitePersistence
- func (s *SQLLitePersistence) AddInstallations(identity []byte, timestamp int64, installations []*Installation, ...) error
- func (s *SQLLitePersistence) DisableInstallation(identity []byte, installationID string) error
- func (s *SQLLitePersistence) EnableInstallation(identity []byte, installationID string) error
- func (s *SQLLitePersistence) GetActiveInstallations(maxInstallations int, identity []byte) ([]*Installation, error)
- type Service
- func (s *Service) DisableInstallation(myIdentityKey *ecdsa.PublicKey, installationID string) error
- func (s *Service) EnableInstallation(identity *ecdsa.PublicKey, installationID string) error
- func (s *Service) GetActiveInstallations(identity *ecdsa.PublicKey) ([]*Installation, error)
- func (s *Service) GetOurActiveInstallations(identity *ecdsa.PublicKey) ([]*Installation, error)
- func (s *Service) ProcessPublicBundle(myIdentityKey *ecdsa.PrivateKey, theirIdentity *ecdsa.PublicKey, ...) ([]*IdentityAndID, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdentityAndID ¶
type Installation ¶
type Persistence ¶
type Persistence interface { // GetActiveInstallations returns the active installations for a given identity. GetActiveInstallations(maxInstallations int, identity []byte) ([]*Installation, error) // EnableInstallation enables the installation. EnableInstallation(identity []byte, installationID string) error // DisableInstallation disable the installation. DisableInstallation(identity []byte, installationID string) error // AddInstallations adds the installations for a given identity, maintaining the enabled flag AddInstallations(identity []byte, timestamp int64, installations []*Installation, defaultEnabled bool) error }
type SQLLitePersistence ¶
type SQLLitePersistence struct {
// contains filtered or unexported fields
}
SQLLitePersistence represents a persistence service tied to an SQLite database
func NewSQLLitePersistence ¶
func NewSQLLitePersistence(db *sql.DB) *SQLLitePersistence
NewSQLLitePersistence creates a new SQLLitePersistence instance, given a path and a key
func (*SQLLitePersistence) AddInstallations ¶
func (s *SQLLitePersistence) AddInstallations(identity []byte, timestamp int64, installations []*Installation, defaultEnabled bool) error
AddInstallations adds the installations for a given identity, maintaining the enabled flag
func (*SQLLitePersistence) DisableInstallation ¶
func (s *SQLLitePersistence) DisableInstallation(identity []byte, installationID string) error
DisableInstallation disable the installation
func (*SQLLitePersistence) EnableInstallation ¶
func (s *SQLLitePersistence) EnableInstallation(identity []byte, installationID string) error
EnableInstallation enables the installation
func (*SQLLitePersistence) GetActiveInstallations ¶
func (s *SQLLitePersistence) GetActiveInstallations(maxInstallations int, identity []byte) ([]*Installation, error)
GetActiveInstallations returns the active installations for a given identity
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func New ¶
func New(config *Config, persistence Persistence) *Service
func (*Service) DisableInstallation ¶
func (*Service) EnableInstallation ¶
func (*Service) GetActiveInstallations ¶
func (s *Service) GetActiveInstallations(identity *ecdsa.PublicKey) ([]*Installation, error)
func (*Service) GetOurActiveInstallations ¶
func (s *Service) GetOurActiveInstallations(identity *ecdsa.PublicKey) ([]*Installation, error)
func (*Service) ProcessPublicBundle ¶
func (s *Service) ProcessPublicBundle(myIdentityKey *ecdsa.PrivateKey, theirIdentity *ecdsa.PublicKey, b *protobuf.Bundle) ([]*IdentityAndID, error)
ProcessPublicBundle persists a bundle and returns a list of tuples identity/installationID
Click to show internal directories.
Click to hide internal directories.