server

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2020 License: AGPL-3.0 Imports: 36 Imported by: 0

Documentation

Overview

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Nging is a toolbox for webmasters Copyright (C) 2018-present Wenhui Shen <swh@admpub.com>

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Index

Constants

This section is empty.

Variables

View Source
var (
	CancelRealTimeStatusCollection context.CancelFunc
)
View Source
var ErrNotImplemented = errors.New("not implemented yet")

Functions

func Cmd

func Cmd(ctx echo.Context) error

func CmdSendBySockJS

func CmdSendBySockJS(c sockjs.Session) error

func CmdSendByWebsocket

func CmdSendByWebsocket(c *websocket.Conn, ctx echo.Context) error

func Command

func Command(ctx echo.Context) error

func CommandAdd

func CommandAdd(ctx echo.Context) error

func CommandDelete

func CommandDelete(ctx echo.Context) error

func CommandEdit

func CommandEdit(ctx echo.Context) error

func Connections added in v1.1.0

func Connections(ctx echo.Context) (err error)

func DaemonAdd

func DaemonAdd(ctx echo.Context) error

func DaemonDelete

func DaemonDelete(ctx echo.Context) error

func DaemonEdit

func DaemonEdit(ctx echo.Context) error

func DaemonIndex

func DaemonIndex(ctx echo.Context) error

func DaemonLog

func DaemonLog(ctx echo.Context) error

func DaemonRestart

func DaemonRestart(ctx echo.Context) error

func ExecCommand

func ExecCommand(id uint) (*dbschema.Command, string, error)

func Hosts

func Hosts(ctx echo.Context) error

func Info

func Info(ctx echo.Context) error

func InfoBySockJS

func InfoBySockJS(c sockjs.Session) error

func InfoByWebsocket

func InfoByWebsocket(c *websocket.Conn, ctx echo.Context) error

func ListenRealTimeStatus

func ListenRealTimeStatus()

func NetStatTCP added in v1.1.0

func NetStatTCP() (<-chan net.ConnectionStat, error)

func NetStatUDP added in v1.1.0

func NetStatUDP() (<-chan net.ConnectionStat, error)

func ProcessInfo added in v1.1.0

func ProcessInfo(ctx echo.Context) error

func ProcessKill added in v1.1.0

func ProcessKill(ctx echo.Context) error

func Service

func Service(ctx echo.Context) error

Types

type DynamicInformation

type DynamicInformation struct {
	CPUPercent []float64
	Load       *load.AvgStat `json:",omitempty"`
	Memory     *MemoryInformation
	NetIO      []net.IOCountersStat `json:",omitempty"`
}

func (*DynamicInformation) Init

func (*DynamicInformation) MemoryAndCPU

func (d *DynamicInformation) MemoryAndCPU() *DynamicInformation

func (*DynamicInformation) NetMemoryCPU

func (d *DynamicInformation) NetMemoryCPU() *DynamicInformation

type LastTimeValue

type LastTimeValue struct {
	Time  time.Time
	Value float64
}

type MemoryInformation

type MemoryInformation struct {
	Virtual *mem.VirtualMemoryStat
	Swap    *mem.SwapMemoryStat
}

type NetIOTimeSeries

type NetIOTimeSeries struct {
	BytesSent   TimeSeries
	BytesRecv   TimeSeries
	PacketsSent TimeSeries
	PacketsRecv TimeSeries
	// contains filtered or unexported fields
}

func NewNetIOTimeSeries

func NewNetIOTimeSeries() NetIOTimeSeries

type RealTimeStatus

type RealTimeStatus struct {
	CPU TimeSeries
	Mem TimeSeries
	Net NetIOTimeSeries
	// contains filtered or unexported fields
}

func NewRealTimeStatus

func NewRealTimeStatus(interval time.Duration, maxSize int) *RealTimeStatus

func (*RealTimeStatus) CPUAdd

func (r *RealTimeStatus) CPUAdd(y float64) *RealTimeStatus

func (*RealTimeStatus) Listen

func (r *RealTimeStatus) Listen(ctx context.Context) *RealTimeStatus

func (*RealTimeStatus) MemAdd

func (r *RealTimeStatus) MemAdd(y float64) *RealTimeStatus

func (*RealTimeStatus) NetAdd

type SystemInformation

type SystemInformation struct {
	CPU        []cpu.InfoStat
	CPUPercent []float64
	Partitions []disk.PartitionStat
	DiskUsages []*disk.UsageStat
	DiskIO     map[string]disk.IOCountersStat
	Host       *host.InfoStat
	Load       *load.AvgStat
	Memory     *MemoryInformation
	NetIO      []net.IOCountersStat
}

type TimeSeries

type TimeSeries []XY

type XY

type XY [2]interface{}

func NewXY

func NewXY(y float64) XY

Jump to

Keyboard shortcuts

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