auth

package
v0.0.0-...-8ec3fd9 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccount

func CreateAccount(ctx context.Context, db db.Queryer, accountID uuid.UUID, password string) (err error)

func CreateSession

func CreateSession(ctx context.Context, db db.Queryer, accountID uuid.UUID) (token string, err error)

func DeleteAccount

func DeleteAccount(ctx context.Context, db db.Queryer, accountID uuid.UUID) (err error)

func DeleteSession

func DeleteSession(ctx context.Context, db db.Queryer, token string) (err error)

func RefreshSession

func RefreshSession(ctx context.Context, db db.Queryer, oldToken string) (newToken string, err error)

Types

type Account

type Account struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ApiKey

type ApiKey struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time

	Name string
}

type Session

type Session struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time

	AccountID uuid.UUID
}

func GetSessionsForAccount

func GetSessionsForAccount(ctx context.Context, db db.Queryer, accountID uuid.UUID) (sessions []Session, err error)

Jump to

Keyboard shortcuts

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