owner

package
v0.0.0-...-bae6b6e Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 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 OwnerStorage

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

OwnerStorage represents a PostgreSQL implementation of the storage for owners.

func New

func New(db *sqlx.DB) *OwnerStorage

New creates a new instance of OwnerStorage with the given database connection.

func (*OwnerStorage) AddOwner

func (r *OwnerStorage) AddOwner(ctx context.Context, owner entities.Owner) (entities.Owner, error)

AddOwner adds a new owner to the database and returns the newly created owner.

func (*OwnerStorage) DeleteOwnerByID

func (r *OwnerStorage) DeleteOwnerByID(ctx context.Context, id int64) error

DeleteOwnerByID deletes an owner by their ID.

func (*OwnerStorage) GetOwnerById

func (s *OwnerStorage) GetOwnerById(ctx context.Context, id int64) (entities.Owner, error)

GetOwnerById retrieves an owner by their ID.

func (*OwnerStorage) GetOwnerByTelegramId

func (s *OwnerStorage) GetOwnerByTelegramId(ctx context.Context, id int64) (entities.Owner, error)

GetOwnerByTelegramId retrieves an owner by their Telegram ID.

Jump to

Keyboard shortcuts

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