tinkoff

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandListener

type CommandListener struct {
	*Context
	flu.Clock
	*core.ControlButtons
	Credentials CredentialStore
	Executors   []Executor
}

func (*CommandListener) AuthorizedUserIDs

func (l *CommandListener) AuthorizedUserIDs() map[telegram.ID]bool

func (*CommandListener) Update_bank_statement

func (l *CommandListener) Update_bank_statement(ctx context.Context, tgclient telegram.Client, cmd *telegram.Command) error

type Context

type Context struct {
	Storage
	Reload time.Duration
}

type Credential

type Credential struct {
	Username, Password string
}

type CredentialStore

type CredentialStore map[telegram.ID]Credential

type Executor

type Executor interface {
	Name() string
	Run(ctx context.Context, sync *Sync) (int, error)
}

type Extension

type Extension []Executor

func (Extension) Apply

func (e Extension) Apply(ctx context.Context, app app.Interface, buttons *core.ControlButtons) (interface{}, error)

func (Extension) Buttons

func (e Extension) Buttons() []telegram.Button

func (Extension) ID

func (e Extension) ID() string

type SQLStorage

type SQLStorage gorm.DB

func (*SQLStorage) GetLatestTime

func (s *SQLStorage) GetLatestTime(ctx context.Context, entity interface{}, tenant interface{}) (time.Time, error)

func (*SQLStorage) Init

func (s *SQLStorage) Init(ctx context.Context) error

func (*SQLStorage) Insert

func (s *SQLStorage) Insert(ctx context.Context, batch interface{}) error

func (*SQLStorage) Unmask

func (s *SQLStorage) Unmask() *gorm.DB

func (*SQLStorage) UpdateAccounts

func (s *SQLStorage) UpdateAccounts(ctx context.Context, accounts []external.Account) error

type Storage

type Storage interface {
	UpdateAccounts(ctx context.Context, batch []external.Account) error
	GetLatestTime(ctx context.Context, entity interface{}, tenant interface{}) (time.Time, error)
	Insert(ctx context.Context, batch interface{}) error
}

type Sync

type Sync struct {
	*Context
	*external.Client
	Now time.Time
	// contains filtered or unexported fields
}

func (*Sync) Run

func (s *Sync) Run(ctx context.Context, executor Executor) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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