Documentation ¶
Index ¶
- Variables
- func ExtractJobId(jobId string) (string, int32, int, uint64, error)
- func GenerateJobId(prefix string, height int32, index int, difficulty uint64) string
- type BlockLog
- func (l *BlockLog) GetClientIP() string
- func (l *BlockLog) GetExtName() string
- func (l *BlockLog) GetHash() string
- func (l *BlockLog) GetHeight() int32
- func (l *BlockLog) GetHostName() string
- func (l *BlockLog) GetPid() int32
- func (l *BlockLog) GetServerIP() string
- func (l *BlockLog) GetUserAgent() string
- func (l *BlockLog) GetUserName() string
- func (l *BlockLog) GetWorkerName() string
- func (l *BlockLog) SetClientIP(ip string) *BlockLog
- func (l *BlockLog) SetExtName(extName string) *BlockLog
- func (l *BlockLog) SetHash(hash string) *BlockLog
- func (l *BlockLog) SetHeight(height int32) *BlockLog
- func (l *BlockLog) SetHostName(hostName string) *BlockLog
- func (l *BlockLog) SetPid(pid int32) *BlockLog
- func (l *BlockLog) SetServerIP(ip string) *BlockLog
- func (l *BlockLog) SetUserAgent(userAgent string) *BlockLog
- func (l *BlockLog) SetUserName(userName string) *BlockLog
- func (l *BlockLog) SetWorkerName(workerName string) *BlockLog
- type LogService
- type Manager
- func (m *Manager) GetLogService() LogService
- func (m *Manager) GetSphereService() StratumService
- func (m *Manager) GetStatsService() StatsService
- func (m *Manager) GetUserService() UserService
- func (m *Manager) Init() error
- func (m *Manager) SetLogService(service LogService) *Manager
- func (m *Manager) SetSphereService(service StratumService) *Manager
- func (m *Manager) SetStatsService(service StatsService) *Manager
- func (m *Manager) SetUserService(service UserService) *Manager
- type ShareBlockHash
- type ShareComputePower
- type ShareLog
- func (l *ShareLog) GetClientIP() string
- func (l *ShareLog) GetComputePower() float64
- func (l *ShareLog) GetExtName() string
- func (l *ShareLog) GetHeight() int32
- func (l *ShareLog) GetHostName() string
- func (l *ShareLog) GetIsRight() bool
- func (l *ShareLog) GetPid() int32
- func (l *ShareLog) GetServerIP() string
- func (l *ShareLog) GetUserAgent() string
- func (l *ShareLog) GetUserName() string
- func (l *ShareLog) GetWorkerName() string
- func (l *ShareLog) SetClientIP(ip string) *ShareLog
- func (l *ShareLog) SetComputePower(computePower float64) *ShareLog
- func (l *ShareLog) SetExtName(extName string) *ShareLog
- func (l *ShareLog) SetHeight(height int32) *ShareLog
- func (l *ShareLog) SetHostName(hostName string) *ShareLog
- func (l *ShareLog) SetIsRight(isRight bool) *ShareLog
- func (l *ShareLog) SetPid(pid int32) *ShareLog
- func (l *ShareLog) SetServerIP(ip string) *ShareLog
- func (l *ShareLog) SetUserAgent(userAgent string) *ShareLog
- func (l *ShareLog) SetUserName(userName string) *ShareLog
- func (l *ShareLog) SetWorkerName(workerName string) *ShareLog
- type ShareResult
- type ShareState
- type StatsService
- type StratumConfig
- type StratumJob
- type StratumJobMeta
- type StratumService
- type StratumShare
- type StratumShareCoinBase
- type StratumShareHeader
- type StratumShareMeta
- type SubscribeHandler
- type SysInfo
- type UserService
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorExtractJobId = errors.New("extract job id error.")
)
Functions ¶
Types ¶
type BlockLog ¶
type BlockLog struct {
// contains filtered or unexported fields
}
func NewBlockLog ¶
func NewBlockLog() *BlockLog
func (*BlockLog) GetClientIP ¶
func (*BlockLog) GetExtName ¶
func (*BlockLog) GetHostName ¶
func (*BlockLog) GetServerIP ¶
func (*BlockLog) GetUserAgent ¶
func (*BlockLog) GetUserName ¶
func (*BlockLog) GetWorkerName ¶
func (*BlockLog) SetClientIP ¶
func (*BlockLog) SetExtName ¶
func (*BlockLog) SetHostName ¶
func (*BlockLog) SetServerIP ¶
func (*BlockLog) SetUserAgent ¶
func (*BlockLog) SetUserName ¶
func (*BlockLog) SetWorkerName ¶
type LogService ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) GetLogService ¶
func (m *Manager) GetLogService() LogService
func (*Manager) GetSphereService ¶
func (m *Manager) GetSphereService() StratumService
func (*Manager) GetStatsService ¶
func (m *Manager) GetStatsService() StatsService
func (*Manager) GetUserService ¶
func (m *Manager) GetUserService() UserService
func (*Manager) SetLogService ¶
func (m *Manager) SetLogService(service LogService) *Manager
func (*Manager) SetSphereService ¶
func (m *Manager) SetSphereService(service StratumService) *Manager
func (*Manager) SetStatsService ¶
func (m *Manager) SetStatsService(service StatsService) *Manager
func (*Manager) SetUserService ¶
func (m *Manager) SetUserService(service UserService) *Manager
type ShareBlockHash ¶
type ShareBlockHash string
type ShareComputePower ¶
type ShareComputePower float64
type ShareLog ¶
type ShareLog struct {
// contains filtered or unexported fields
}
func NewShareLog ¶
func NewShareLog() *ShareLog
func (*ShareLog) GetClientIP ¶
func (*ShareLog) GetComputePower ¶
func (*ShareLog) GetExtName ¶
func (*ShareLog) GetHostName ¶
func (*ShareLog) GetIsRight ¶
func (*ShareLog) GetServerIP ¶
func (*ShareLog) GetUserAgent ¶
func (*ShareLog) GetUserName ¶
func (*ShareLog) GetWorkerName ¶
func (*ShareLog) SetClientIP ¶
func (*ShareLog) SetComputePower ¶
func (*ShareLog) SetExtName ¶
func (*ShareLog) SetHostName ¶
func (*ShareLog) SetIsRight ¶
func (*ShareLog) SetServerIP ¶
func (*ShareLog) SetUserAgent ¶
func (*ShareLog) SetUserName ¶
func (*ShareLog) SetWorkerName ¶
type ShareResult ¶
type ShareResult struct {}
type ShareState ¶
type ShareState int
const ( SeparatorJobId = "_" StateUnknown ShareState = iota StateSuccess StateSuccessSubmitBlock StateErrJobNotFound )
type StatsService ¶
type StatsService interface { Init() error }
type StratumConfig ¶
type StratumConfig struct { CoinType string PoolTag string PayoutAddress string ExtraNonce1Length int ExtraNonce2Length int }
func NewStratumConfig ¶
func NewStratumConfig() *StratumConfig
type StratumJob ¶
type StratumJob struct { JobId string PrevHash string CoinBase1 string CoinBase2 string MerkleBranch []string Version string NBits string NTime string CleanJobs bool Meta *StratumJobMeta }
func NewStratumJob ¶
func NewStratumJob() *StratumJob
func (*StratumJob) Fill ¶
func (job *StratumJob) Fill(jobId string, ts int64, cleanJobs bool) *StratumJob
func (*StratumJob) ToJSONInterface ¶
func (job *StratumJob) ToJSONInterface() []interface{}
func (*StratumJob) ToShare ¶
func (job *StratumJob) ToShare() *StratumShare
type StratumJobMeta ¶
func NewStratumJobMeta ¶
func NewStratumJobMeta() *StratumJobMeta
type StratumService ¶
type StratumService interface { Init() error Register(config *StratumConfig, info *SysInfo) error GetLatestStratumJob() (*StratumJob, error) Subscribe(ctx context.Context, handler SubscribeHandler) UnRegister() (bool, error) }
type StratumShare ¶
type StratumShare struct {}
func NewStratumShare ¶
func NewStratumShare() *StratumShare
type StratumShareCoinBase ¶
type StratumShareCoinBase struct {}
type StratumShareHeader ¶
type StratumShareHeader struct {}
type StratumShareMeta ¶
type StratumShareMeta struct {}
func NewStratumShareMeta ¶
func NewStratumShareMeta() *StratumShareMeta
func (*StratumShareMeta) GetHeight ¶
func (meta *StratumShareMeta) GetHeight() int32
func (*StratumShareMeta) GetJobCurTs ¶
func (meta *StratumShareMeta) GetJobCurTs() int32
type SubscribeHandler ¶
type SubscribeHandler func(job *StratumJob)
type SysInfo ¶
type SysInfo struct {
// contains filtered or unexported fields
}
func NewSysInfo ¶
func NewSysInfo() *SysInfo
func (*SysInfo) GetHostName ¶
type UserService ¶
type UserService interface { Init() error Login(username string, password string) proto.AuthorizeResult }
Click to show internal directories.
Click to hide internal directories.