repo

package
v0.0.0-...-748ecea Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package repo contains implements for app.Repo. Provide session info to and from repository.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Cockroach  connectors.CockroachDB
	MigrateDir string
	Driver     string
}

Config provide connection info for database.

type Repo

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

Repo provided data from and to database.

func New

func New(ctx context.Context, reg *prometheus.Registry, namespace string, cfg Config) (*Repo, error)

New build and returns session db.

func (*Repo) ByID

func (r *Repo) ByID(ctx context.Context, sessionID uuid.UUID) (s *app.Session, err error)

ByID for implements app.Repo.

func (*Repo) Close

func (r *Repo) Close() error

Close implements io.Closer.

func (*Repo) Delete

func (r *Repo) Delete(ctx context.Context, sessionID uuid.UUID) error

Delete for implements app.Repo.

func (*Repo) Save

func (r *Repo) Save(ctx context.Context, session app.Session) error

Save for implements app.Repo.

func (*Repo) UpdateStatus

func (r *Repo) UpdateStatus(ctx context.Context, reqID, userID uuid.UUID, status dom.UserStatus) error

Jump to

Keyboard shortcuts

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