base

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2025 License: Apache-2.0, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner interface {
	Run()
	GetInfo() interface{}
}

type Strategy

type Strategy struct {
	Mut            sync.RWMutex
	Lock           sync.Mutex
	Logger         *zap.Logger
	Running        atomic.Bool
	MainCtx        context.Context
	MainCancel     context.CancelFunc
	Wg             sync.WaitGroup
	PriceProviders map[string]providertypes.Provider
	PreviousPrices map[string]float64
	LastExecution  time.Time
	Cfg            *types.Config
	Runner         Runner
}

func NewBaseStrategy

func NewBaseStrategy(cfg *types.Config, logger *zap.Logger, runner Runner) *Strategy

func (*Strategy) GetLastExecutionTime

func (s *Strategy) GetLastExecutionTime() time.Time

func (*Strategy) GetPrices

func (s *Strategy) GetPrices() (map[string]float64, error)

func (*Strategy) Info

func (s *Strategy) Info() interface{}

func (*Strategy) IsRunning

func (s *Strategy) IsRunning() bool

func (*Strategy) Start

func (s *Strategy) Start() error

func (*Strategy) Stop

func (s *Strategy) Stop()

Jump to

Keyboard shortcuts

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