Documentation ¶
Index ¶
- Constants
- func CheckParamBool(r *http.Request, key string, defValue bool) bool
- func CheckParamHex(r *http.Request, key string, defv []byte) []byte
- func CheckParamHexMustLen(r *http.Request, key string, mustLen int) []byte
- func CheckParamString(r *http.Request, key string, defValue string) string
- func CheckParamUint64(r *http.Request, key string, defValue uint64) uint64
- func CheckParamUint64Must(r *http.Request, w http.ResponseWriter, key string) (uint64, bool)
- func ResponseCreateData(key string, value interface{}) map[string]interface{}
- func ResponseData(w http.ResponseWriter, data map[string]interface{})
- func ResponseError(w http.ResponseWriter, err error)
- func ResponseErrorString(w http.ResponseWriter, errstr string)
- func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)
- func ResponseJSON(w http.ResponseWriter, resobj interface{}) error
- func ResponseJSONbytes(w http.ResponseWriter, content []byte) error
- func ResponseList(w http.ResponseWriter, data interface{})
- func ResponseLocation(w http.ResponseWriter, url string)
- type ConnClient
- type MinerRelayServiceConfig
- type RelayService
- type StoreItemUserMiningResult
Constants ¶
View Source
const KeyAutoIdxUserMiningResult = "autoidx1"
Variables ¶
This section is empty.
Functions ¶
func CheckParamHexMustLen ¶
func CheckParamUint64Must ¶
func ResponseCreateData ¶
func ResponseData ¶
func ResponseData(w http.ResponseWriter, data map[string]interface{})
func ResponseError ¶
func ResponseError(w http.ResponseWriter, err error)
func ResponseErrorString ¶
func ResponseErrorString(w http.ResponseWriter, errstr string)
func ResponseErrorStringWithCode ¶
func ResponseErrorStringWithCode(w http.ResponseWriter, errcode int, errstr string)
func ResponseJSON ¶
func ResponseJSON(w http.ResponseWriter, resobj interface{}) error
func ResponseJSONbytes ¶
func ResponseJSONbytes(w http.ResponseWriter, content []byte) error
func ResponseList ¶
func ResponseList(w http.ResponseWriter, data interface{})
func ResponseLocation ¶
func ResponseLocation(w http.ResponseWriter, url string)
Types ¶
type ConnClient ¶
type ConnClient struct {
// contains filtered or unexported fields
}
func NewConnClient ¶
func NewConnClient(server *RelayService, conn *net.TCPConn, rwdaddr fields.Address) *ConnClient
type MinerRelayServiceConfig ¶
type MinerRelayServiceConfig struct { ServerAddress *net.TCPAddr IsReportHashrate bool // Whether to report calculation force statistics IsAcceptHashrate bool // Whether to accept calculation force statistics ServerTcpListenPort int // TCP server listening port MaxWorkerConnect int // TCP Max connections HttpApiListenPort int // HTTP API data interface service // Log StuffForwardPrintEvery int // Data storage StoreEnable bool // Storage on DataDir string // catalogue SaveMiningBlockStuff bool // Save mining block information SaveMiningHash bool // Whether to save the submitted block hash value SaveMiningNonce bool // Save submitted nonce value }
func NewEmptyMinerRelayServiceConfig ¶
func NewEmptyMinerRelayServiceConfig() *MinerRelayServiceConfig
func NewMinerRelayServiceConfig ¶
func NewMinerRelayServiceConfig(cnffile *sys.Inicnf) *MinerRelayServiceConfig
type RelayService ¶
type RelayService struct {
// contains filtered or unexported fields
}
func NewRelayService ¶
func NewRelayService(cnf *MinerRelayServiceConfig) *RelayService
func (*RelayService) SetHashratePool ¶
func (r *RelayService) SetHashratePool(pool interfaces2.HashratePool)
func (*RelayService) Start ¶
func (r *RelayService) Start()
type StoreItemUserMiningResult ¶
type StoreItemUserMiningResult struct { BodyVersion uint8 // Version number IsMintSuccessed uint8 // Mining success IsSaveMiningResultHash uint8 // Save hash MiningResultHash fields.Hash IsSaveMiningResultNonce uint8 // Save nonce MiningResultHeadNonce fields.Bytes4 MiningResultCoinbaseNonce fields.Hash // contains filtered or unexported fields }
func NewStoreItemUserMiningResultV0 ¶
func NewStoreItemUserMiningResultV0() *StoreItemUserMiningResult
func (*StoreItemUserMiningResult) Describe ¶
func (s *StoreItemUserMiningResult) Describe() map[string]interface{}
json api
func (*StoreItemUserMiningResult) Parse ¶
func (s *StoreItemUserMiningResult) Parse(buf []byte, seek uint32) (uint32, error)
func (*StoreItemUserMiningResult) Serialize ¶
func (s *StoreItemUserMiningResult) Serialize() []byte
Click to show internal directories.
Click to hide internal directories.