serv

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2022 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultMsg = "Request Accepted"
)

Variables

This section is empty.

Functions

func CheckTimeouts added in v0.5.0

func CheckTimeouts(timeouts *rpc.HTTPTimeouts)

CheckTimeouts ensures that timeout values are meaningful

func CreateWallet

func CreateWallet(password, name, mnemonic, hdPath string) string

CreateWallet

func GetWalletAddress

func GetWalletAddress() error

GetWalletAddress

func GetWallets added in v0.6.0

func GetWallets(walletAddress string, password string) ([]fs.FileInfo, error)

func Login

func Login(walletAddress, password string) error

Login

func NewHTTPHandlerStack added in v0.5.0

func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler

NewHTTPHandlerStack returns wrapped http-related handlers

func RegisterApis added in v0.5.0

func RegisterApis(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error

RegisterApis checks the given modules' availability, generates an allowlist based on the allowed modules, and then registers all of the APIs exposed by the services.

func RpcLogService added in v0.5.0

func RpcLogService() *rpcLogService

func ShowMonitor

func ShowMonitor()

ShowMonitor

func Start

func Start()

func StartDumpTrafficLog added in v0.5.0

func StartDumpTrafficLog()

func StartHTTPEndpoint added in v0.5.0

func StartHTTPEndpoint(endpoint string, timeouts rpc.HTTPTimeouts, handler http.Handler) (*http.Server, net.Addr, error)

StartHTTPEndpoint starts the HTTP RPC endpoint.

func StopDumpTrafficLog added in v0.5.0

func StopDumpTrafficLog()

func StopMonitor

func StopMonitor()

StopMonitor

func TerminalAPI added in v0.5.0

func TerminalAPI() *terminalCmd

func Wallets

func Wallets()

Wallets get all wallets

Types

type CmdResult added in v0.5.0

type CmdResult struct {
	Msg string
}

type CpuInfo added in v0.5.0

type CpuInfo struct {
	CpuInfos       []SingleCpuInfo `json:"cpu_infos"`
	CpuUsedPercent float64         `json:"cpu_used_percent"`
}

func NewCpuInfo added in v0.5.0

func NewCpuInfo(cpuInfos []SingleCpuInfo, cpuUsedPercent float64) CpuInfo

type HdInfo added in v0.5.0

type HdInfo struct {
	HdTotal       uint64  `json:"hd_total"`
	HdFree        uint64  `json:"hd_free"`
	HdUsed        uint64  `json:"hd_used"`
	HdUsedPercent float64 `json:"hd_used_percent"`
}

func NewHdInfo added in v0.5.0

func NewHdInfo(hdTotal uint64, hdFree uint64, hdUsed uint64, hdUsedPercent float64) HdInfo

type LogMsg added in v0.5.0

type LogMsg struct {
	Msg string `json:"msg"`
}

type MemInfo added in v0.5.0

type MemInfo struct {
	MemTotal       uint64  `json:"mem_total"`
	MemFree        uint64  `json:"mem_free"`
	MemUsed        uint64  `json:"mem_used"`
	MemUsedPercent float64 `json:"mem_used_percent"`
}

func NewMemInfo added in v0.5.0

func NewMemInfo(memTotal uint64, memFree uint64, memUsed uint64, memUsedPercent float64) MemInfo

type SingleCpuInfo added in v0.5.0

type SingleCpuInfo struct {
	CpuModelName string `json:"cpu_model_name"`
	CpuCores     int32  `json:"cpu_cores"`
}

func NewSingleCpuInfo added in v0.5.0

func NewSingleCpuInfo(cpuModelName string, cpuCores int32) SingleCpuInfo

type TrafficDumpInfo added in v0.5.0

type TrafficDumpInfo struct {
	MemInfo     MemInfo     `json:"mem_info"`
	CpuInfo     CpuInfo     `json:"cpu_info"`
	HdInfo      HdInfo      `json:"hd_info"`
	TrafficInfo TrafficInfo `json:"traffic_info"`
}

func NewTrafficDumpInfo added in v0.5.0

func NewTrafficDumpInfo(memInfo MemInfo, cpuInfo CpuInfo, hdInfo HdInfo, trafficInfo TrafficInfo) TrafficDumpInfo

type TrafficInfo added in v0.5.0

type TrafficInfo struct {
	TrafficInbound  uint64 `json:"traffic_inbound"`
	TrafficOutbound uint64 `json:"traffic_outbound"`
}

func NewTrafficInfo added in v0.5.0

func NewTrafficInfo(trafficInbound uint64, trafficOutbound uint64) TrafficInfo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL