model

package
v0.0.0-...-f236415 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func DeleteIntegrityContextKeyByCreateTime

func DeleteIntegrityContextKeyByCreateTime(ctx context.Context, tx *database.Tx, before time.Time) error

Types

type IntegrityContextKey

type IntegrityContextKey struct {
	ID         string `db:"id"`
	Secret     []byte `db:"secret"`
	CreateTime int64  `db:"create_time"`
}

func InsertIntegrityContextKey

func InsertIntegrityContextKey(ctx context.Context, tx *database.Tx, key *crypto.Key) (*IntegrityContextKey, error)

func SelectIntegrityContextKey

func SelectIntegrityContextKey(ctx context.Context, tx *database.Tx) (*IntegrityContextKey, error)

func SelectIntegrityContextKeyByID

func SelectIntegrityContextKeyByID(ctx context.Context, tx *database.Tx, id string) (*IntegrityContextKey, error)

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 SelectUserSessionByID(ctx context.Context, tx *database.Tx, id string) (*UserSession, error)

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 SelectUserSessionRequestByID

func SelectUserSessionRequestByID(ctx context.Context, tx *database.Tx, id string) (*UserSessionRequest, error)

func (*UserSessionRequest) ToDomain

func (*UserSessionRequest) UpdateFromDomain

func (r *UserSessionRequest) UpdateFromDomain(ctx context.Context, tx *database.Tx, userSessionRequest *domain.UserSessionRequest) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL