postgres

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDuplicatedKeyError

func IsDuplicatedKeyError(err error) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

Types

type Storage

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

func New

func New(cfg *config.Config) (*Storage, error)

func (*Storage) Close

func (s *Storage) Close()

func (*Storage) DelAdmin

func (s *Storage) DelAdmin(ctx context.Context, email string, appName string) error

func (*Storage) DelApp

func (s *Storage) DelApp(ctx context.Context, appName string) error

func (*Storage) GetApp

func (s *Storage) GetApp(ctx context.Context, appName string) (models.App, error)

func (*Storage) GetAppID

func (s *Storage) GetAppID(ctx context.Context, appName string) (models.App, error)

func (*Storage) GetUser

func (s *Storage) GetUser(ctx context.Context, email string) (models.User, error)

func (*Storage) IsAdmin

func (s *Storage) IsAdmin(ctx context.Context, userID uint64, appName string) error

func (*Storage) IsCreator

func (s *Storage) IsCreator(ctx context.Context, userID uint64, appName string) error

func (*Storage) SaveUser

func (s *Storage) SaveUser(ctx context.Context, email string, passHash []byte) (uint64, error)

func (*Storage) SetAdmin

func (s *Storage) SetAdmin(ctx context.Context, email string, appName string) error

func (*Storage) SetApp

func (s *Storage) SetApp(ctx context.Context, appName string, appSecret string) (int, error)

func (*Storage) SetCreator

func (s *Storage) SetCreator(ctx context.Context, userID uint64, appID int) error

func (*Storage) UpdApp

func (s *Storage) UpdApp(ctx context.Context, appName, newAppName, newAppSecret string) error

Jump to

Keyboard shortcuts

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