postgres

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package postgres provides a Postgres Store implementation and schema migration for Canopy.

Index

Constants

View Source
const Migration = `` /* 1937-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func New

func New(db *sql.DB) *Store

func (*Store) ConsumeVerification

func (s *Store) ConsumeVerification(ctx context.Context, identifier, value string, now time.Time) (*canopy.Verification, error)

func (*Store) CreateAccount

func (s *Store) CreateAccount(ctx context.Context, a *canopy.Account) error

func (*Store) CreateSession

func (s *Store) CreateSession(ctx context.Context, ses *canopy.Session) error

func (*Store) CreateUser

func (s *Store) CreateUser(ctx context.Context, u *canopy.User) error

func (*Store) CreateUserAccount added in v0.1.1

func (s *Store) CreateUserAccount(ctx context.Context, u *canopy.User, a *canopy.Account) error

func (*Store) CreateVerification

func (s *Store) CreateVerification(ctx context.Context, v *canopy.Verification) error

func (*Store) DeleteExpiredVerifications

func (s *Store) DeleteExpiredVerifications(ctx context.Context, now time.Time) error

func (*Store) DeleteSessionByToken

func (s *Store) DeleteSessionByToken(ctx context.Context, token string) error

func (*Store) DeleteUserSessions

func (s *Store) DeleteUserSessions(ctx context.Context, userID string) error

func (*Store) FindAccount

func (s *Store) FindAccount(ctx context.Context, providerID, accountID string) (*canopy.Account, error)

func (*Store) FindAccountByUserProvider

func (s *Store) FindAccountByUserProvider(ctx context.Context, userID, providerID string) (*canopy.Account, error)

func (*Store) FindSessionByToken

func (s *Store) FindSessionByToken(ctx context.Context, token string) (*canopy.SessionData, error)

func (*Store) FindUserByEmail

func (s *Store) FindUserByEmail(ctx context.Context, email string) (*canopy.User, error)

func (*Store) FindUserByID

func (s *Store) FindUserByID(ctx context.Context, id string) (*canopy.User, error)

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context) error

func (*Store) UpdateAccount

func (s *Store) UpdateAccount(ctx context.Context, a *canopy.Account) error

func (*Store) UpdateSession

func (s *Store) UpdateSession(ctx context.Context, ses *canopy.Session) error

func (*Store) UpdateUser

func (s *Store) UpdateUser(ctx context.Context, u *canopy.User) error

Jump to

Keyboard shortcuts

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