api

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0, MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotSupported = errors.New("method not supported")

Functions

This section is empty.

Types

type Common

type Common interface {

	// Version provides information about API provider
	Version(context.Context) (sharedTypes.Version, error) //perm:read

	LogList(context.Context) ([]string, error)         //perm:write
	LogSetLevel(context.Context, string, string) error //perm:write

	// trigger graceful shutdown
	Shutdown(context.Context) error //perm:admin

	// Session returns a random UUID of api provider session
	Session(context.Context) (uuid.UUID, error) //perm:read

	Closing(context.Context) (<-chan struct{}, error) //perm:read
}

type CommonMethods

type CommonMethods struct {
	Closing func(p0 context.Context) (<-chan struct{}, error) `perm:"read"`

	LogList func(p0 context.Context) ([]string, error) `perm:"write"`

	LogSetLevel func(p0 context.Context, p1 string, p2 string) error `perm:"write"`

	Session func(p0 context.Context) (uuid.UUID, error) `perm:"read"`

	Shutdown func(p0 context.Context) error `perm:"admin"`

	Version func(p0 context.Context) (sharedTypes.Version, error) `perm:"read"`
}

type CommonStruct

type CommonStruct struct {
	Internal CommonMethods
}

func (*CommonStruct) Closing

func (s *CommonStruct) Closing(p0 context.Context) (<-chan struct{}, error)

func (*CommonStruct) LogList

func (s *CommonStruct) LogList(p0 context.Context) ([]string, error)

func (*CommonStruct) LogSetLevel

func (s *CommonStruct) LogSetLevel(p0 context.Context, p1 string, p2 string) error

func (*CommonStruct) Session

func (s *CommonStruct) Session(p0 context.Context) (uuid.UUID, error)

func (*CommonStruct) Shutdown

func (s *CommonStruct) Shutdown(p0 context.Context) error

func (*CommonStruct) Version

type CommonStub

type CommonStub struct {
}

func (*CommonStub) Closing

func (s *CommonStub) Closing(p0 context.Context) (<-chan struct{}, error)

func (*CommonStub) LogList

func (s *CommonStub) LogList(p0 context.Context) ([]string, error)

func (*CommonStub) LogSetLevel

func (s *CommonStub) LogSetLevel(p0 context.Context, p1 string, p2 string) error

func (*CommonStub) Session

func (s *CommonStub) Session(p0 context.Context) (uuid.UUID, error)

func (*CommonStub) Shutdown

func (s *CommonStub) Shutdown(p0 context.Context) error

func (*CommonStub) Version

func (s *CommonStub) Version(p0 context.Context) (sharedTypes.Version, error)

type MinerAPI

type MinerAPI interface {
	Common

	UpdateAddress(context.Context, int64, int64) ([]types.MinerInfo, error)                                        //perm:admin
	ListAddress(context.Context) ([]types.MinerInfo, error)                                                        //perm:read
	StatesForMining(context.Context, []address.Address) ([]types.MinerState, error)                                //perm:read
	CountWinners(context.Context, []address.Address, abi.ChainEpoch, abi.ChainEpoch) ([]types.CountWinners, error) //perm:read
	ListBlocks(ctx context.Context, params *types.BlocksQueryParams) ([]types.MinedBlock, error)                   //perm:read
	WarmupForMiner(context.Context, address.Address) error                                                         //perm:write
	Start(context.Context, []address.Address) error                                                                //perm:admin
	Stop(context.Context, []address.Address) error                                                                 //perm:admin

	QueryRecord(ctx context.Context, params *types.QueryRecordParams) ([]map[string]string, error) //perm:read
}

type MinerAPIMethods

type MinerAPIMethods struct {
	CountWinners func(p0 context.Context, p1 []address.Address, p2 abi.ChainEpoch, p3 abi.ChainEpoch) ([]types.CountWinners, error) `perm:"read"`

	ListAddress func(p0 context.Context) ([]types.MinerInfo, error) `perm:"read"`

	ListBlocks func(p0 context.Context, p1 *types.BlocksQueryParams) ([]types.MinedBlock, error) `perm:"read"`

	QueryRecord func(p0 context.Context, p1 *types.QueryRecordParams) ([]map[string]string, error) `perm:"read"`

	Start func(p0 context.Context, p1 []address.Address) error `perm:"admin"`

	StatesForMining func(p0 context.Context, p1 []address.Address) ([]types.MinerState, error) `perm:"read"`

	Stop func(p0 context.Context, p1 []address.Address) error `perm:"admin"`

	UpdateAddress func(p0 context.Context, p1 int64, p2 int64) ([]types.MinerInfo, error) `perm:"admin"`

	WarmupForMiner func(p0 context.Context, p1 address.Address) error `perm:"write"`
}

type MinerAPIStruct

type MinerAPIStruct struct {
	CommonStruct

	Internal MinerAPIMethods
}

func (*MinerAPIStruct) CountWinners

func (s *MinerAPIStruct) CountWinners(p0 context.Context, p1 []address.Address, p2 abi.ChainEpoch, p3 abi.ChainEpoch) ([]types.CountWinners, error)

func (*MinerAPIStruct) ListAddress

func (s *MinerAPIStruct) ListAddress(p0 context.Context) ([]types.MinerInfo, error)

func (*MinerAPIStruct) ListBlocks added in v1.13.0

func (*MinerAPIStruct) QueryRecord added in v1.13.0

func (s *MinerAPIStruct) QueryRecord(p0 context.Context, p1 *types.QueryRecordParams) ([]map[string]string, error)

func (*MinerAPIStruct) Start

func (s *MinerAPIStruct) Start(p0 context.Context, p1 []address.Address) error

func (*MinerAPIStruct) StatesForMining

func (s *MinerAPIStruct) StatesForMining(p0 context.Context, p1 []address.Address) ([]types.MinerState, error)

func (*MinerAPIStruct) Stop

func (s *MinerAPIStruct) Stop(p0 context.Context, p1 []address.Address) error

func (*MinerAPIStruct) UpdateAddress

func (s *MinerAPIStruct) UpdateAddress(p0 context.Context, p1 int64, p2 int64) ([]types.MinerInfo, error)

func (*MinerAPIStruct) WarmupForMiner

func (s *MinerAPIStruct) WarmupForMiner(p0 context.Context, p1 address.Address) error

type MinerAPIStub

type MinerAPIStub struct {
	CommonStub
}

func (*MinerAPIStub) CountWinners

func (s *MinerAPIStub) CountWinners(p0 context.Context, p1 []address.Address, p2 abi.ChainEpoch, p3 abi.ChainEpoch) ([]types.CountWinners, error)

func (*MinerAPIStub) ListAddress

func (s *MinerAPIStub) ListAddress(p0 context.Context) ([]types.MinerInfo, error)

func (*MinerAPIStub) ListBlocks added in v1.13.0

func (*MinerAPIStub) QueryRecord added in v1.13.0

func (s *MinerAPIStub) QueryRecord(p0 context.Context, p1 *types.QueryRecordParams) ([]map[string]string, error)

func (*MinerAPIStub) Start

func (s *MinerAPIStub) Start(p0 context.Context, p1 []address.Address) error

func (*MinerAPIStub) StatesForMining

func (s *MinerAPIStub) StatesForMining(p0 context.Context, p1 []address.Address) ([]types.MinerState, error)

func (*MinerAPIStub) Stop

func (s *MinerAPIStub) Stop(p0 context.Context, p1 []address.Address) error

func (*MinerAPIStub) UpdateAddress

func (s *MinerAPIStub) UpdateAddress(p0 context.Context, p1 int64, p2 int64) ([]types.MinerInfo, error)

func (*MinerAPIStub) WarmupForMiner

func (s *MinerAPIStub) WarmupForMiner(p0 context.Context, p1 address.Address) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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