Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigtableRecordStore ¶
type BigtableRecordStore struct {
// contains filtered or unexported fields
}
func NewBigtableRecordStore ¶
func (BigtableRecordStore) Close ¶
func (bt BigtableRecordStore) Close()
func (BigtableRecordStore) GetRecord ¶
func (bt BigtableRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)
func (BigtableRecordStore) WriteRecord ¶
func (bt BigtableRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error
type DynamoDbRecordStore ¶
type DynamoDbRecordStore struct {
// contains filtered or unexported fields
}
func NewDynamoDbRecordStore ¶
func (DynamoDbRecordStore) GetRecord ¶
func (db DynamoDbRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)
func (DynamoDbRecordStore) WriteRecord ¶
func (db DynamoDbRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error
type MemoryRecordStore ¶
type MemoryRecordStore struct {
// contains filtered or unexported fields
}
func (*MemoryRecordStore) GetRecord ¶
func (m *MemoryRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)
func (*MemoryRecordStore) WriteRecord ¶
func (m *MemoryRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error
type MongoRecordStore ¶
type MongoRecordStore struct {
// contains filtered or unexported fields
}
func NewMongoRecordStore ¶
func (MongoRecordStore) GetRecord ¶
func (m MongoRecordStore) GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error)
func (MongoRecordStore) WriteRecord ¶
func (m MongoRecordStore) WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error
type NotRegistered ¶
type NotRegistered struct{}
type RecordStore ¶
type RecordStore interface { // Returns a processed UserRecord deserialized from the database or a default // record if nothing is currently stored. Also returns the raw record read // from the database – this must be passed to WriteRecord to ensure atomic operation. GetRecord(ctx context.Context, recordID UserRecordID) (UserRecord, interface{}, error) // The write will only be performed if the record in the database still matches // the record that was read. WriteRecord(ctx context.Context, recordID UserRecordID, record UserRecord, readRecord interface{}) error }
RecordStore represents a generic interface into the database storage provider of your choice.
func NewMemoryRecordStore ¶
func NewMemoryRecordStore() RecordStore
func NewRecordStore ¶
func NewRecordStore(ctx context.Context, provider types.ProviderName, opts types.ProviderOptions, realmID types.RealmID) (RecordStore, error)
type Registered ¶
type Registered struct { Version types.RegistrationVersion `cbor:"version"` OprfPrivateKey types.OprfPrivateKey `cbor:"oprf_private_key"` OprfSignedPublicKey types.OprfSignedPublicKey `cbor:"oprf_signed_public_key"` UnlockKeyCommitment types.UnlockKeyCommitment `cbor:"unlock_key_commitment"` UnlockKeyTag types.UnlockKeyTag `cbor:"unlock_key_tag"` EncryptedSecret types.EncryptedSecret `cbor:"encrypted_secret"` EncryptedSecretCommitment types.EncryptedSecretCommitment `cbor:"encrypted_secret_commitment"` GuessCount uint16 `cbor:"guess_count"` Policy types.Policy `cbor:"policy"` }
type UserRecord ¶
type UserRecord struct {
// oneof Registered, NotRegistered, NoGuesses
RegistrationState interface{} `cbor:"registration_state"`
}
func DefaultUserRecord ¶
func DefaultUserRecord() UserRecord
func (*UserRecord) MarshalCBOR ¶
func (ur *UserRecord) MarshalCBOR() ([]byte, error)
func (*UserRecord) UnmarshalCBOR ¶
func (ur *UserRecord) UnmarshalCBOR(data []byte) error
type UserRecordID ¶
type UserRecordID string
func CreateUserRecordID ¶
func CreateUserRecordID(tenantName string, userID string) (UserRecordID, error)
Click to show internal directories.
Click to hide internal directories.