db

package
v3.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 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 Database

type Database interface {
	Get(context.Context, func(pgx.Row) error, string, ...any) error
	Create(context.Context, string, ...any) (uint64, error)
	One(context.Context, string, ...any) error
	DoAtomic(context.Context, func(context.Context) error) error
}

type Service

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

func New

func New(db Database) Service

func (Service) Create

func (s Service) Create(ctx context.Context) (model.User, error)

func (Service) CreateBasic added in v3.0.1

func (s Service) CreateBasic(ctx context.Context, login, password string) (model.User, error)

func (Service) CreateGithub added in v3.0.1

func (s Service) CreateGithub(ctx context.Context) (model.User, string, error)

func (Service) Delete

func (s Service) Delete(ctx context.Context, o model.User) error

func (Service) DoAtomic

func (s Service) DoAtomic(ctx context.Context, action func(context.Context) error) error

func (Service) GetBasicUser

func (s Service) GetBasicUser(ctx context.Context, _ *http.Request, login, password string) (model.User, error)

func (Service) GetGitHubUser

func (s Service) GetGitHubUser(ctx context.Context, id uint64, registration string) (model.User, error)

func (Service) IsAuthorized

func (s Service) IsAuthorized(ctx context.Context, user model.User, profile string) bool

func (Service) UpdateGitHubUser

func (s Service) UpdateGitHubUser(ctx context.Context, user model.User, githubID, githubLogin string) error

func (Service) UpdatePassword

func (s Service) UpdatePassword(ctx context.Context, user model.User, password string) error

Jump to

Keyboard shortcuts

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