Documentation ¶
Overview ¶
Generated from https://github.com/streamrail/concurrent-map
Index ¶
- Constants
- Variables
- type Block
- type BlockTemplate
- type Config
- type ErrorReply
- type Frontend
- type JSONRpcReq
- type JSONRpcResp
- type JobReplyData
- type Miner
- type MinersMap
- func (m MinersMap) Count() int
- func (m MinersMap) Get(key string) (*Miner, bool)
- func (m MinersMap) GetShard(key string) *MinersMapShared
- func (m *MinersMap) Has(key string) bool
- func (m *MinersMap) IsEmpty() bool
- func (m MinersMap) Iter() <-chan Tuple
- func (m MinersMap) IterBuffered() <-chan Tuple
- func (m *MinersMap) Remove(key string)
- func (m *MinersMap) Set(key string, value *Miner)
- type MinersMapShared
- type Proxy
- type ProxyServer
- type Session
- type SubmitReply
- type Tuple
- type Upstream
Constants ¶
View Source
const (
MaxReqSize = 1 * 1024
)
Variables ¶
View Source
var SHARD_COUNT = 32
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// contains filtered or unexported fields
}
func (Block) Difficulty ¶
func (Block) HashNoNonce ¶
type BlockTemplate ¶
type Config ¶
type Config struct { Proxy Proxy `json:"proxy"` Frontend Frontend `json:"frontend"` Upstream []Upstream `json:"upstream"` UpstreamCheckInterval string `json:"upstreamCheckInterval"` Threads int `json:"threads"` NewrelicName string `json:"newrelicName"` NewrelicKey string `json:"newrelicKey"` NewrelicVerbose bool `json:"newrelicVerbose"` NewrelicEnabled bool `json:"newrelicEnabled"` }
type ErrorReply ¶
type JSONRpcReq ¶
type JSONRpcReq struct { Id *json.RawMessage `json:"id"` Method string `json:"method"` Params *json.RawMessage `json:"params"` }
type JSONRpcResp ¶
type JSONRpcResp struct { Id *json.RawMessage `json:"id"` Version string `json:"jsonrpc"` Result interface{} `json:"result"` Error interface{} `json:"error,omitempty"` }
type JobReplyData ¶
type MinersMap ¶
type MinersMap []*MinersMapShared
A "thread" safe map of type string:*Miner. To avoid lock bottlenecks this map is dived to several (SHARD_COUNT) map shards.
func (MinersMap) GetShard ¶
func (m MinersMap) GetShard(key string) *MinersMapShared
Returns shard under given key
func (MinersMap) IterBuffered ¶
Returns a buffered iterator which could be used in a for range loop.
type MinersMapShared ¶
type MinersMapShared struct { // contains filtered or unexported fields }
type Proxy ¶
type Proxy struct { Listen string `json:"listen"` ClientTimeout string `json:"clientTimeout"` BlockRefreshInterval string `json:"blockRefreshInterval"` HashrateWindow string `json:"hashrateWindow"` SubmitHashrate bool `json:"submitHashrate"` LuckWindow string `json:"luckWindow"` LargeLuckWindow string `json:"largeLuckWindow"` }
type ProxyServer ¶
type ProxyServer struct {
// contains filtered or unexported fields
}
func NewEndpoint ¶
func NewEndpoint(cfg *Config) *ProxyServer
func (*ProxyServer) ServeHTTP ¶
func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*ProxyServer) StatsIndex ¶
func (s *ProxyServer) StatsIndex(w http.ResponseWriter, r *http.Request)
type SubmitReply ¶
type SubmitReply struct {
Status string `json:"status"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.