postgres

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UsersTable string
	RolesTable string
}

Config controls table names for identity persistence.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default table names.

type Repo

type Repo struct {
	Pool ports.DatabasePool
	// contains filtered or unexported fields
}

Repo persists identity users in Postgres.

func NewRepo

func NewRepo(pool ports.DatabasePool, cfg Config) *Repo

NewRepo constructs a Repo with normalized config.

func (*Repo) Create

func (r *Repo) Create(ctx context.Context, u *identity.User) error

func (*Repo) GetByID

func (r *Repo) GetByID(ctx context.Context, id string) (*identity.User, error)

func (*Repo) GetByIdentity

func (r *Repo) GetByIdentity(ctx context.Context, provider, subject string) (*identity.User, error)

func (*Repo) ListRoles

func (r *Repo) ListRoles(ctx context.Context, userID string) ([]string, error)

func (*Repo) ReplaceRoles

func (r *Repo) ReplaceRoles(ctx context.Context, userID string, roles []string, at time.Time) error

func (*Repo) Update

func (r *Repo) Update(ctx context.Context, u *identity.User) error

Jump to

Keyboard shortcuts

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