lkdr

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const JobID = "lkdr"

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Receipt(ctx context.Context, in *lkdr.ReceiptIn) (*lkdr.ReceiptOut, error)
	FiscalData(ctx context.Context, in *lkdr.FiscalDataIn) (*lkdr.FiscalDataOut, error)
}

type ClientFactory

type ClientFactory func(params lkdr.ClientParams) (Client, error)

type Config

type Config struct {
	Database  database.Config         `yaml:"database" doc:"Настройки подключения к БД."`
	BatchSize int                     `` /* 202-byte string literal not displayed */
	Timeout   time.Duration           `yaml:"timeout,omitempty" default:"5m" doc:"Таймаут для запросов."`
	Users     map[string][]Credential `yaml:"users" doc:"Пользователи и их авторизационные данные."`
}

type Credential

type Credential struct {
	Phone     string `yaml:"phone" pattern:"7\\d{10}" doc:"Номер телефона пользователя."`
	DeviceID  string `` /* 572-byte string literal not displayed */
	UserAgent string `` /* 371-byte string literal not displayed */
}

type Job

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

func NewJob

func NewJob(ctx context.Context, params JobParams) (*Job, error)

func (*Job) ID

func (j *Job) ID() string

func (*Job) Run

func (j *Job) Run(ctx jobs.Context, _ time.Time, userID string) (errs error)

type JobParams

type JobParams struct {
	Config        Config       `validate:"required"`
	Clock         based.Clock  `validate:"required"`
	Logger        *slog.Logger `validate:"required"`
	ClientFactory ClientFactory
	CaptchaSolver captcha.TokenProvider
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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