pgrepo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

func New

func New(pool *pgxpool.Pool) *Repo

func (*Repo) AllActiveUserIDs

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

func (*Repo) AnalyticsSummary

func (r *Repo) AnalyticsSummary(ctx context.Context, since time.Time) ([]app.AnalyticsSummary, error)

func (*Repo) ChangePlan

func (r *Repo) ChangePlan(ctx context.Context, workspaceID, toPlan, actor, reason string, now time.Time) (string, error)

func (*Repo) CountUsers

func (r *Repo) CountUsers(ctx context.Context, q, status string) (int, error)

func (*Repo) CountWorkspaces

func (r *Repo) CountWorkspaces(ctx context.Context, q string) (int, error)

func (*Repo) ExportAuditCSV

func (r *Repo) ExportAuditCSV(ctx context.Context, q audit.ListQuery, actorIDs []string, maxRows int, w io.Writer) (bool, error)

func (*Repo) ExportUserdata

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

func (*Repo) GetStats

func (r *Repo) GetStats(ctx context.Context) (*app.PlatformStats, error)

func (*Repo) GetUserByID

func (r *Repo) GetUserByID(ctx context.Context, userID string) (app.AdminUser, bool, error)

func (*Repo) GetWorkspaceByID

func (r *Repo) GetWorkspaceByID(ctx context.Context, id string) (app.AdminWorkspace, bool, error)

func (*Repo) ListAudit

func (r *Repo) ListAudit(ctx context.Context, workspaceID string, limit int) ([]app.AuditEntry, error)

func (*Repo) ListSSOProviders

func (r *Repo) ListSSOProviders(ctx context.Context) ([]app.SSOProviderRow, error)

func (*Repo) ListUserWorkspaces

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

func (*Repo) ListUsers

func (r *Repo) ListUsers(ctx context.Context, q, status string, limit, offset int) ([]app.AdminUser, error)

func (*Repo) ListWorkspaceMembers

func (r *Repo) ListWorkspaceMembers(ctx context.Context, workspaceID string) ([]app.WsMember, error)

func (*Repo) ListWorkspaces

func (r *Repo) ListWorkspaces(ctx context.Context, q string, limit, offset int) ([]app.AdminWorkspace, error)

func (*Repo) PlanExists

func (r *Repo) PlanExists(ctx context.Context, code string) (bool, error)

func (*Repo) QueryAudit

func (r *Repo) QueryAudit(ctx context.Context, q audit.ListQuery) ([]app.AuditEntry, int, error)

func (*Repo) QueryAuditExt

func (r *Repo) QueryAuditExt(ctx context.Context, q audit.ListQuery, actorIDs []string) ([]app.AuditEntry, int, error)

func (*Repo) SetPlatformAdmin

func (r *Repo) SetPlatformAdmin(ctx context.Context, userID string, isAdmin bool) error

func (*Repo) SetUserStatus

func (r *Repo) SetUserStatus(ctx context.Context, userID, status string) error

func (*Repo) UserIDsByEmailPrefix

func (r *Repo) UserIDsByEmailPrefix(ctx context.Context, emailPrefix string, limit int) ([]string, error)

Jump to

Keyboard shortcuts

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