Documentation
¶
Overview ¶
Package postgres provides a postgresql-backed implementation of the user.Store interface
Index ¶
- type Store
- func (s *Store) Add(ctx context.Context, u *user.User) error
- func (s *Store) Find(ctx context.Context, possibleIdentifiers identifier.Set) (*user.User, error)
- func (s *Store) Get(ctx context.Context, key string) (*user.User, error)
- func (s *Store) GetByIdentifier(ctx context.Context, id identifier.Identifier) (*user.User, error)
- func (s *Store) SetPreferences(ctx context.Context, key string, prefs preference.Map) error
- type UserModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewPostgresStore ¶
NewPostgresStore creates a new postgres store
func (*Store) GetByIdentifier ¶
func (s *Store) GetByIdentifier(ctx context.Context, id identifier.Identifier) (*user.User, error)
GetByIdentifier implements user.Store.
func (*Store) SetPreferences ¶
SetPreferences implements user.Store.
type UserModel ¶
type UserModel struct { Key string `gorm:"primarykey"` Preferences preference.Map `gorm:"serializer:json"` // Identifiers is a map of all identifiers for the user Identifiers map[identifier.NamespaceAndKind]string `gorm:"serializer:json"` // Emails contains the subset of Identifiers that have Kind=="email" (for easier fallback lookup) Emails []string `gorm:"serializer:json"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
UserModel is the gorm model for a user
Click to show internal directories.
Click to hide internal directories.