Documentation ¶
Index ¶
- Constants
- Variables
- func CloseRows(r *sql.Rows)
- func CloseStmt(s *sql.Stmt)
- func GetDbInstance() *sql.DB
- func GetSettingPlotdirs() (plotpaths string)
- func Init(datadir string)
- func Start()
- type Host
- type IEthereum
- type InputSettingAction
- type InputSettingPlotdir
- type MineDevice
- func (dev *MineDevice) Bind(miner common.Address, auth string) (r Result)
- func (dev *MineDevice) Getting(name string) (r Result)
- func (dev *MineDevice) GettingHostname() (r Result)
- func (dev *MineDevice) GettingPlotdirs() (r Result)
- func (dev *MineDevice) Login() (r Result)
- func (dev *MineDevice) Restart() (r Result)
- func (dev *MineDevice) Setting(name string, value string) (r Result)
- func (dev *MineDevice) SettingHostname(hostname string) (r Result)
- func (dev *MineDevice) SettingPlotdirs(value string) (r Result)
- func (dev *MineDevice) Status() (r Result)
- func (dev *MineDevice) Unbind(miner common.Address, auth string) (r Result)
- type Plot
- func (p *Plot) GetAllPlotWorks() (retworks []plotter.Work)
- func (plot *Plot) GetFullPlotPath() (plotpath string)
- func (p *Plot) InsertNew() (err error)
- func (p *Plot) NonceAllocate(id, plotSeed string, plotsize uint64) (s uint64, n uint64, e error)
- func (p *Plot) PlotSelectedByIds(id uint64, path string) (err error)
- func (p *Plot) PlotUnselectedByIds(id uint64, path string) (err error)
- func (p *Plot) QueryAllPlotInfo() (plots []Plot, e error)
- func (p *Plot) QueryByIds(id uint64, path string) (err error)
- func (p *Plot) UpdateByIds(id uint64) (err error)
- func (p *Plot) UpdatePlotParamById(id uint64) (err error)
- type Result
- type UPnPDevice
- type Uatk
- type UatkInfo
- type User
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
View Source
const ( STATUS_OK = 0 STATUS_DELETED = 1 STATUS_INVALID = 99 )
View Source
const ( PLOT_STATUS_UNUSED = 0 //未选中,未使用 PLOT_STATUS_PLOTTING = 1 //已选中,p盘中 PLOT_STATUS_PAUSED = 2 //已选中,p盘暂停中 PLOT_STATUS_STOPED = 3 //未选中,p盘主动取消 PLOT_STATUS_DONE = 9 //已选中,p盘完成 )
View Source
const ( DEV_STATUS_UNBIND = "unbind" DEV_STATUS_BINDED = "binded" DEV_STATUS_SYNCING = "syncing" DEV_STATUS_PLOTTING = "plotting" DEV_STATUS_MINNING = "minning" DEV_STATUS_WAITING = "waiting" )
View Source
const ( ACTION_SELECT = "SELECT" ACTION_UNSELECT = "UNSELECT" ACTION_RMDATA = "RMDATA" )
View Source
const ( DefaultTarget = "Living" DefaultStatus = true )
View Source
const (
DEFAULT_PLOTDIR = "${MOUNTPOINT}/plotdata/"
)
View Source
const (
DefaultTimeFormat = "2006-01-02 15:04:05"
)
Variables ¶
View Source
var ( DefaultDescription = "description.xml" DefaultDatabase = "database.sqlite" RWLock sync.RWMutex )
View Source
var PlotpathsUpdater = make(chan string, 100)
Functions ¶
func GetDbInstance ¶
func GetSettingPlotdirs ¶
func GetSettingPlotdirs() (plotpaths string)
Types ¶
type Host ¶
type Host struct { Hostname string `json:"hostname"` Status string `json:"status"` CreateTime string `json:"create_time"` ModifyTime string `json:"modify_time"` }
func (*Host) ClsHostInfo ¶
func (*Host) ModHostInfo ¶
func (*Host) QueryHostInfo ¶
type IEthereum ¶
type IEthereum interface { StopMining() IsMining() bool Miner() *miner.Miner IsPloting() bool Downloader() *downloader.Downloader Plotter() *plotter.Plotter Engine() consensus.Engine }
type InputSettingAction ¶
type InputSettingAction string
type InputSettingPlotdir ¶
type InputSettingPlotdir struct { Plot Action InputSettingAction `json:"action"` }
type MineDevice ¶
type MineDevice struct {
// contains filtered or unexported fields
}
func New ¶
func New(ieth IEthereum) *MineDevice
func (*MineDevice) Getting ¶
func (dev *MineDevice) Getting(name string) (r Result)
func (*MineDevice) GettingHostname ¶
func (dev *MineDevice) GettingHostname() (r Result)
func (*MineDevice) GettingPlotdirs ¶
func (dev *MineDevice) GettingPlotdirs() (r Result)
func (*MineDevice) Login ¶
func (dev *MineDevice) Login() (r Result)
func (*MineDevice) Restart ¶
func (dev *MineDevice) Restart() (r Result)
func (*MineDevice) SettingHostname ¶
func (dev *MineDevice) SettingHostname(hostname string) (r Result)
func (*MineDevice) SettingPlotdirs ¶
func (dev *MineDevice) SettingPlotdirs(value string) (r Result)
func (*MineDevice) Status ¶
func (dev *MineDevice) Status() (r Result)
type Plot ¶
type Plot struct { Id uint64 `json:"id"` Name string `json:"name"` Path string `json:"path"` Uuid string `json:"uuid"` DiskSize uint64 `json:"disksize"` FreeSize uint64 `json:"freesize"` PlotSeed string `json:"plotseed"` PlotSize uint64 `json:"plotsize"` PlotDir string `json:"plotdir"` PlotParam string `json:"plotparam"` Status int `json:"status"` }
func (*Plot) GetAllPlotWorks ¶
func (*Plot) GetFullPlotPath ¶
func (*Plot) NonceAllocate ¶
func (*Plot) PlotSelectedByIds ¶
func (*Plot) PlotUnselectedByIds ¶
func (*Plot) QueryAllPlotInfo ¶
func (*Plot) UpdateByIds ¶
func (*Plot) UpdatePlotParamById ¶
type UPnPDevice ¶
var Instance *UPnPDevice
func GetInstance ¶
func GetInstance() *UPnPDevice
func NewLightDevice ¶
func NewLightDevice() (*UPnPDevice, error)
func (*UPnPDevice) ActionRequestReceived ¶
func (self *UPnPDevice) ActionRequestReceived(action *upnp.Action) upnp.Error
func (*UPnPDevice) RefreshDeviceData ¶
func (self *UPnPDevice) RefreshDeviceData()
type Uatk ¶
type Uatk struct { SessionId string `json:"sessionid"` SessionValues string `json:"sessionvalues"` CreateTime string `json:"create_time"` ModifyTime string `json:"modify_time"` }
func (*Uatk) InsertSessionValues ¶
type User ¶
type User struct { Username string `json:"username"` Password string `json:"password"` CreateTime string `json:"create_time"` ModifyTime string `json:"modify_time"` }
func (*User) ModBindUser ¶
func (*User) QueryBindUser ¶
Click to show internal directories.
Click to hide internal directories.