Documentation ¶
Index ¶
- Variables
- func CalculateDifficulty(multiplier int64) uint64
- func GetDevice() (interface{}, error)
- func IsValid(previous []byte, difficult uint64, w Work) bool
- func NewWorkerCPU() (*cpuWorker, error)
- func NewWorkerCPUThread(threads uint64) (*cpuWorker, error)
- func NewWorkerGPU(_ interface{}) (*noneGPUWorker, error)
- func NewWorkerGPUThread(_ uint64, _ interface{}) (*noneGPUWorker, error)
- type Context
- type Pool
- type Work
- type WorkerGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotSupported = errors.New("that device don't support that type of work method") ErrNoDeviceAvailable = errors.New("no device found") ErrNoDefaultPoolAvailable = errors.New("no default pool found") )
View Source
var ( V1BaseDifficult = CalculateDifficulty(0) V2BaseDifficult = CalculateDifficulty(8) V2ReceiveDifficult = CalculateDifficulty(-8) )
Functions ¶
func CalculateDifficulty ¶
func NewWorkerCPU ¶
func NewWorkerCPU() (*cpuWorker, error)
func NewWorkerCPUThread ¶
func NewWorkerGPU ¶
func NewWorkerGPU(_ interface{}) (*noneGPUWorker, error)
func NewWorkerGPUThread ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func NewContext() *Context
type Pool ¶
type Pool struct {
Workers []WorkerGenerator
}
var DefaultWorkerPool *Pool // We don't use DefaultWorkerPool = newDefaultPool() because it slow down the init
func NewPool ¶
func NewPool(w ...WorkerGenerator) (p *Pool)
Click to show internal directories.
Click to hide internal directories.