session

package
v1.18.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	*Session
	net.Conn
	// contains filtered or unexported fields
}

Track SessionConn

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) Read

func (c *Conn) Read(b []byte) (n int, err error)

func (*Conn) Write

func (c *Conn) Write(b []byte) (n int, err error)

type Monitor

type Monitor interface {
	Start() error
	Stop() error

	// METHODS
	AddSession(key interface{}, session *Session)
	RemoveSession(key interface{})
}

type PacketConn

type PacketConn struct {
	*Session
	net.PacketConn
	// contains filtered or unexported fields
}

Track SessionPacketConn

func (*PacketConn) Close

func (c *PacketConn) Close() error

func (*PacketConn) ReadFrom

func (c *PacketConn) ReadFrom(b []byte) (n int, addr net.Addr, err error)

func (*PacketConn) WriteTo

func (c *PacketConn) WriteTo(b []byte, addr net.Addr) (n int, err error)

type Server

type Server struct {
	sync.Mutex
	*http.Server

	ServeAddr string
	// contains filtered or unexported fields
}

func New

func New(addr string) *Server

func (*Server) AddSession

func (s *Server) AddSession(key interface{}, session *Session)

func (*Server) RemoveSession

func (s *Server) RemoveSession(key interface{})

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

type Session

type Session struct {
	Process       string    `json:"process"`
	Network       string    `json:"network"`
	DialerAddr    string    `json:"dialerAddr"`
	ClientAddr    string    `json:"clientAddr"`
	TargetAddr    string    `json:"targetAddr"`
	UploadBytes   int64     `json:"upload"`
	DownloadBytes int64     `json:"download"`
	SessionStart  time.Time `json:"sessionStart"`
	SessionClose  time.Time `json:"sessionClose"`
}

type Status added in v1.18.3

type Status struct {
	Platform       string    `json:"platform"`
	Version        string    `json:"version"`
	CPU            string    `json:"cpu"`
	MEM            string    `json:"mem"`
	Uptime         string    `json:"uptime"`
	Total          int64     `json:"total"`
	Upload         int64     `json:"upload"`
	Download       int64     `json:"download"`
	Goroutines     int       `json:"goroutines"`
	ActiveSessions []Session `json:"activeSessions"`
	ClosedSessions []Session `json:"closedSessions"`
}

Jump to

Keyboard shortcuts

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