Documentation
¶
Index ¶
- Variables
- func DeleteIntegrityContextKeyByCreateTime(ctx context.Context, tx *database.Tx, before time.Time) error
- type IntegrityContextKey
- func InsertIntegrityContextKey(ctx context.Context, tx *database.Tx, key *crypto.Key) (*IntegrityContextKey, error)
- func SelectIntegrityContextKey(ctx context.Context, tx *database.Tx) (*IntegrityContextKey, error)
- func SelectIntegrityContextKeyByID(ctx context.Context, tx *database.Tx, id string) (*IntegrityContextKey, error)
- type UserSession
- type UserSessionRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var PostgresSchemaScriptOption postgres.ConfigSetter = postgres.WithSchemaScripts(schemaPostgres1Script)
View Source
var SqliteSchemaScriptOption sqlite.ConfigSetter = sqlite.WithSchemaScripts(schemaSQLite1Script)
Functions ¶
Types ¶
type IntegrityContextKey ¶
type IntegrityContextKey struct {
ID string `db:"id"`
Secret []byte `db:"secret"`
CreateTime int64 `db:"create_time"`
}
func (*IntegrityContextKey) ToKey ¶
func (k *IntegrityContextKey) ToKey() *crypto.Key
type UserSession ¶
type UserSession struct {
ID string `db:"id"`
Login string `db:"login"`
Remember bool `db:"remember"`
Verification string `db:"verification"`
Terminated bool `db:"terminated"`
CreateTime int64 `db:"create_time"`
LastAccessTime int64 `db:"last_access_time"`
}
func InsertUserSession ¶
func InsertUserSession(ctx context.Context, tx *database.Tx, userSessionRequest *domain.UserSessionRequest) (*UserSession, error)
func SelectUserSessionByID ¶
func (*UserSession) ToDomain ¶
func (s *UserSession) ToDomain() *domain.UserSession
type UserSessionRequest ¶
type UserSessionRequest struct {
ID string `db:"id"`
AuthInfo []byte `db:"auth_info"`
CreateTime int64 `db:"create_time"`
ExpiryTime int64 `db:"expiry_time"`
}
func InsertUserSessionRequest ¶
func InsertUserSessionRequest(ctx context.Context, tx *database.Tx, userSessionRequest *domain.UserSessionRequest, lifetimeDuration time.Duration) (*UserSessionRequest, error)
func (*UserSessionRequest) ToDomain ¶
func (r *UserSessionRequest) ToDomain(ctx context.Context, icStore domain.IntegrityContextStore) (*domain.UserSessionRequest, error)
func (*UserSessionRequest) UpdateFromDomain ¶
func (r *UserSessionRequest) UpdateFromDomain(ctx context.Context, tx *database.Tx, userSessionRequest *domain.UserSessionRequest) error
Click to show internal directories.
Click to hide internal directories.