Documentation
¶
Index ¶
- Constants
- Variables
- func IsValidField(fieldName string) bool
- type Querier
- type SignalsQuerier
- func (q *SignalsQuerier) CreateUser(ctx context.Context, uniqueIdentifier string, providerName string, ...) (int64, error)
- func (q *SignalsQuerier) DeleteUser(ctx context.Context, id uint64) error
- func (q *SignalsQuerier) DeleteUsers(ctx context.Context, ids []uint64) error
- func (q *SignalsQuerier) UpdateUser(ctx context.Context, providerName string, data json.RawMessage, ...) error
- type User
- func (u *User) Context() context.Context
- func (o *User) Delete(ctx context.Context) error
- func (o *User) FieldDefs() attrs.Definitions
- func (o *User) Insert(ctx context.Context) error
- func (u *User) IsAdmin() bool
- func (u *User) IsAuthenticated() bool
- func (o *User) Reload(ctx context.Context) error
- func (o *User) Save(ctx context.Context) error
- func (u *User) SetContext(ctx context.Context) *User
- func (u *User) SetToken(token *oauth2.Token)
- func (u *User) String() string
- func (u *User) Token() *oauth2.Token
- func (o *User) Update(ctx context.Context) error
Constants ¶
View Source
const ( FieldID = "id" FieldUniqueIdentifier = "unique_identifier" FieldData = "data" FieldCreatedAt = "created_at" FieldUpdatedAt = "updated_at" FieldIsAdministrator = "is_administrator" FieldIsActive = "is_active" )
These fields are synonymous with the field names in the database table Any update to the database table should be reflected here
Variables ¶
View Source
var ( Register = registry.RegisterForDriver GetBackend = registry.BackendForDB )
View Source
var ValidFields = []string{ FieldID, FieldUniqueIdentifier, FieldData, FieldCreatedAt, FieldUpdatedAt, FieldIsAdministrator, FieldIsActive, }
Functions ¶
func IsValidField ¶
Types ¶
type Querier ¶
type Querier interface { Close() error WithTx(tx *sql.Tx) Querier RetrieveUsers(ctx context.Context, limit int32, offset int32, ordering ...string) ([]*User, error) RetrieveUserByID(ctx context.Context, id uint64) (*User, error) RetrieveUserByIdentifier(ctx context.Context, uniqueIdentifier string, providerName string) (*User, error) CreateUser(ctx context.Context, uniqueIdentifier string, providerName string, data json.RawMessage, accessToken string, refreshToken string, tokenType string, expiresAt time.Time, isAdministrator bool, isActive bool) (int64, error) DeleteUser(ctx context.Context, id uint64) error DeleteUsers(ctx context.Context, ids []uint64) error UpdateUser(ctx context.Context, providerName string, data json.RawMessage, accessToken string, refreshToken string, tokenType string, expiresAt time.Time, isAdministrator bool, isActive bool, iD uint64) error }
type SignalsQuerier ¶
type SignalsQuerier struct {
Querier
}
func (*SignalsQuerier) CreateUser ¶
func (*SignalsQuerier) DeleteUser ¶
func (q *SignalsQuerier) DeleteUser(ctx context.Context, id uint64) error
func (*SignalsQuerier) DeleteUsers ¶
func (q *SignalsQuerier) DeleteUsers(ctx context.Context, ids []uint64) error
type User ¶
type User struct { ID uint64 `json:"id"` UniqueIdentifier string `json:"unique_identifier"` ProviderName string `json:"provider_name"` Data json.RawMessage `json:"data"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` TokenType string `json:"token_type"` ExpiresAt time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` IsAdministrator bool `json:"is_administrator"` IsActive bool `json:"is_active"` IsLoggedIn bool `json:"is_logged_in"` // contains filtered or unexported fields }
func (*User) FieldDefs ¶
func (o *User) FieldDefs() attrs.Definitions
func (*User) IsAuthenticated ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.