storage

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPhoneNumber = errors.New("invalid phone number")
)
View Source
var (
	ErrPhoneNumberNotFound = errors.New("phone number not found")
)

Functions

func Module

func Module() fx.Option

Types

type Config

type Config struct {
	Secret []byte
}

type Repository

type Repository interface {
	Store(ctx context.Context, phoneNumber string, telegramID int64) error
	Get(ctx context.Context, phoneNumber string) (int64, error)
	DeleteByPhoneNumber(ctx context.Context, phoneNumber string) error
	DeleteByTelegramID(ctx context.Context, telegramID int64) error
}

type Service

type Service interface {
	Store(ctx context.Context, phoneNumber string, telegramID int64) error
	Get(ctx context.Context, phoneNumber string) (int64, error)
	Delete(ctx context.Context, telegramID int64) error
}

func New

func New(c Config, r Repository, l *zap.Logger) Service

Jump to

Keyboard shortcuts

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