Documentation ¶
Index ¶
- type Callback
- type Client
- func (c *Client) Auth() error
- func (c *Client) Close(noReconnect bool)
- func (c *Client) Dial() (err error)
- func (c *Client) GetWork() ([]string, error)
- func (c *Client) Read()
- func (c *Client) RegisterNotification(method string, callback chan *json.RawMessage)
- func (c *Client) Sick() bool
- func (c *Client) SubmitHashrate(params interface{}) (bool, error)
- func (c *Client) SubmitWork(params interface{}) (bool, error)
- func (c *Client) Subscribe() error
- func (c *Client) UnregisterNotification(method string)
- func (c *Client) Write(data []byte) error
- type Req
- type Resp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { sync.RWMutex ID uint64 FailsCount uint64 // contains filtered or unexported fields }
Client structure
func New ¶
func New(servers string, timeout time.Duration, version, username, password, worker string, tls bool) (*Client, error)
New stratum server client
func (*Client) RegisterNotification ¶
func (c *Client) RegisterNotification(method string, callback chan *json.RawMessage)
RegisterNotification for notifications
func (*Client) SubmitHashrate ¶
SubmitHashrate to stratum server
func (*Client) SubmitWork ¶
SubmitWork to stratum server
func (*Client) UnregisterNotification ¶
UnregisterNotification for notifications
type Req ¶
type Req struct { ID uint64 `json:"id"` Method string `json:"method"` Params interface{} `json:"params"` Worker string `json:"worker,omitempty"` }
Req struct
type Resp ¶
type Resp struct { ID uint64 `json:"id,omitempty"` Method string `json:"method,omitempty"` Version string `json:"jsonrpc,omitempty"` Result *json.RawMessage `json:"result,omitempty"` Params *json.RawMessage `json:"params,omitempty"` Error interface{} `json:"error,omitempty"` }
Resp struct
Click to show internal directories.
Click to hide internal directories.