service

package
v2.6.20 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddrGRPC ma.Multiaddr
	ListenAddrREST string
	Debug          bool

	DBURI  string
	DBName string

	PowAddrAPI    string
	PowAdminToken string

	CollectorRunOnStart   bool
	CollectorFrequency    time.Duration
	CollectorFetchLimit   int
	CollectorFetchTimeout time.Duration

	IndexerRunOnStart     bool
	IndexerFrequency      time.Duration
	IndexerSnapshotMaxAge time.Duration
}

type Service

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

func NewService

func NewService(ctx context.Context, config Config) (*Service, error)

func (*Service) CalculateDealPrice

CalculateDealPrice calculates deal price for a miner.

func (*Service) GetMinerInfo

func (s *Service) GetMinerInfo(ctx context.Context, req *pb.GetMinerInfoRequest) (*pb.GetMinerInfoResponse, error)

GetMinerInfo returns miner's index information for a miner. If no information is available, it returns a codes.NotFound status code.

func (*Service) QueryIndex

func (s *Service) QueryIndex(ctx context.Context, req *pb.QueryIndexRequest) (*pb.QueryIndexResponse, error)

func (*Service) Start

func (s *Service) Start() error

func (*Service) Stop

func (s *Service) Stop()

Jump to

Keyboard shortcuts

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