Documentation ¶
Index ¶
- type Config
- type DealDestroyer
- type Option
- func WithCGroupManager(cGroupManager cgroups.CGroupManager) Option
- func WithConfig(config *YAMLConfig) Option
- func WithDealDestroyer(destroyer DealDestroyer) Option
- func WithEth(eth blockchain.API) Option
- func WithEthkey(ethkey *ecdsa.PrivateKey) Option
- func WithHardware(hardware *hardware.Hardware) Option
- func WithLogger(log *zap.SugaredLogger) Option
- func WithMatcher(matcher matcher.Matcher) Option
- func WithResources(resources *resource.Scheduler) Option
- func WithStorage(storage *state.Storage) Option
- type Salesman
- func (m *Salesman) AskPlan(planID string) (*sonm.AskPlan, error)
- func (m *Salesman) AskPlanByDeal(dealID *sonm.BigInt) (*sonm.AskPlan, error)
- func (m *Salesman) AskPlans() map[string]*sonm.AskPlan
- func (m *Salesman) CGroup(planID string) (cgroups.CGroup, error)
- func (m *Salesman) Close() error
- func (m *Salesman) CreateAskPlan(askPlan *sonm.AskPlan) (string, error)
- func (m *Salesman) Deal(dealID *sonm.BigInt) (*sonm.Deal, error)
- func (m *Salesman) DebugDump() *sonm.SalesmanData
- func (m *Salesman) Network(planID string) (*network.Network, error)
- func (m *Salesman) NextMaintenance() time.Time
- func (m *Salesman) PurgeAskPlans(ctx context.Context) (*sonm.ErrorByStringID, error)
- func (m *Salesman) RemoveAskPlan(ctx context.Context, planID string) error
- func (m *Salesman) Run(ctx context.Context)
- func (m *Salesman) ScheduleMaintenance(timePoint time.Time) error
- func (m Salesman) Validate() error
- type YAMLConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Logger zap.SugaredLogger Storage *state.Storage Resources *resource.Scheduler Hardware *hardware.Hardware Eth blockchain.API CGroupManager cgroups.CGroupManager Matcher matcher.Matcher Ethkey *ecdsa.PrivateKey Config YAMLConfig }
type DealDestroyer ¶ added in v0.4.13
type DealDestroyer interface {
CancelDealTasks(dealID *sonm.BigInt) error
}
type Option ¶
type Option func(*options)
func WithCGroupManager ¶
func WithCGroupManager(cGroupManager cgroups.CGroupManager) Option
func WithConfig ¶
func WithConfig(config *YAMLConfig) Option
func WithDealDestroyer ¶ added in v0.4.13
func WithDealDestroyer(destroyer DealDestroyer) Option
func WithEth ¶
func WithEth(eth blockchain.API) Option
func WithEthkey ¶
func WithEthkey(ethkey *ecdsa.PrivateKey) Option
func WithHardware ¶
func WithLogger ¶
func WithLogger(log *zap.SugaredLogger) Option
func WithMatcher ¶
func WithResources ¶
func WithStorage ¶
type Salesman ¶
type Salesman struct {
// contains filtered or unexported fields
}
func (*Salesman) AskPlanByDeal ¶
func (*Salesman) CreateAskPlan ¶
func (*Salesman) NextMaintenance ¶
func (*Salesman) PurgeAskPlans ¶ added in v0.4.13
func (*Salesman) RemoveAskPlan ¶
func (*Salesman) ScheduleMaintenance ¶
type YAMLConfig ¶
type YAMLConfig struct { RegularBillPeriod time.Duration `yaml:"regular_deal_bill_period" default:"24h"` SpotBillPeriod time.Duration `yaml:"spot_deal_bill_period" default:"1h"` SyncStepTimeout time.Duration `yaml:"sync_step_timeout" default:"2m"` SyncInterval time.Duration `yaml:"sync_interval" default:"10s"` MatcherRetryInterval time.Duration `yaml:"matcher_retry_interval" default:"10s"` }
Click to show internal directories.
Click to hide internal directories.