common

package
v0.0.0-...-108e96f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PANIC = iota
	FATAL
	ERROR
	WARNING
	INFO
	DEBUG
)
View Source
const (
	CMD_ERROR = iota
	CMD_RESPONSE
	CMD_AUTH
	CMD_START_REVERSE_SSH
	CMD_REVERSE_SSH_STARTED
	CMD_STOP_REVERSE_SSH
	CMD_REVERSE_SSH_STOPPED
	CMD_NEW_RULES
	CMD_ADD_SERVER
	CMD_DEL_SERVER
	CMD_SET_PORT
	CMD_SET_KEY
	CMD_SET_METHOD
)

Variables

View Source
var (
	TotalStat = new(TotalStatistic)
	DeltaStat = new(TotalStatistic)
)

Functions

func Debug

func Debug(args ...interface{})

func Debugf

func Debugf(format string, args ...interface{})

func EVPBytesToKey

func EVPBytesToKey(password string, keyLen int) (key []byte)

func Error

func Error(args ...interface{})

func Errorf

func Errorf(format string, args ...interface{})

func Fatal

func Fatal(args ...interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func GenerateRandomString

func GenerateRandomString(length int) (res string)

func HmacMD5

func HmacMD5(key []byte, data []byte) []byte

func HmacSHA1

func HmacSHA1(key []byte, data []byte) []byte

func Info

func Info(args ...interface{})

func Infof

func Infof(format string, args ...interface{})

func MD5Sum

func MD5Sum(d []byte) []byte

func Panic

func Panic(args ...interface{})

func Panicf

func Panicf(format string, args ...interface{})

func PrintVersion

func PrintVersion()

func SHA1Sum

func SHA1Sum(d []byte) []byte

func Warning

func Warning(args ...interface{})

func Warningf

func Warningf(format string, args ...interface{})

Types

type Buffer

type Buffer []*bytes.Buffer

type DebugLog

type DebugLog int
var (
	DebugLevel DebugLog = INFO
)

type Password

type Password string

func (Password) Redacted

func (p Password) Redacted() interface{}

type Statistic

type Statistic struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStatistic

func NewStatistic() *Statistic

func (*Statistic) BytesDownload

func (s *Statistic) BytesDownload(b uint64)

func (*Statistic) ClearDownload

func (s *Statistic) ClearDownload()

func (*Statistic) ClearFailedCount

func (s *Statistic) ClearFailedCount()

func (*Statistic) ClearLatency

func (s *Statistic) ClearLatency()

func (*Statistic) ClearUpload

func (s *Statistic) ClearUpload()

func (*Statistic) GetFailedCount

func (s *Statistic) GetFailedCount() uint32

func (*Statistic) GetHighestLastHourBps

func (s *Statistic) GetHighestLastHourBps() uint64

func (*Statistic) GetHighestLastMinuteBps

func (s *Statistic) GetHighestLastMinuteBps() uint64

func (*Statistic) GetHighestLastSecondBps

func (s *Statistic) GetHighestLastSecondBps() uint64

func (*Statistic) GetHighestLastTenMinutesBps

func (s *Statistic) GetHighestLastTenMinutesBps() uint64

func (*Statistic) GetLastHourBps

func (s *Statistic) GetLastHourBps() uint64

func (*Statistic) GetLastMinuteBps

func (s *Statistic) GetLastMinuteBps() uint64

func (*Statistic) GetLastSecondBps

func (s *Statistic) GetLastSecondBps() uint64

func (*Statistic) GetLastTenMinutesBps

func (s *Statistic) GetLastTenMinutesBps() uint64

func (*Statistic) GetLatency

func (s *Statistic) GetLatency() int64

func (*Statistic) GetTotalDownload

func (s *Statistic) GetTotalDownload() uint64

func (*Statistic) GetTotalUploaded

func (s *Statistic) GetTotalUploaded() uint64

func (*Statistic) IncreaseFailedCount

func (s *Statistic) IncreaseFailedCount()

func (*Statistic) IncreaseTotalDownload

func (s *Statistic) IncreaseTotalDownload(b uint64)

func (*Statistic) IncreaseTotalUpload

func (s *Statistic) IncreaseTotalUpload(b uint64)

func (*Statistic) SetFailedCount

func (s *Statistic) SetFailedCount(b uint32)

func (*Statistic) SetHighestLastHourBps

func (s *Statistic) SetHighestLastHourBps(b uint64)

func (*Statistic) SetHighestLastMinuteBps

func (s *Statistic) SetHighestLastMinuteBps(b uint64)

func (*Statistic) SetHighestLastSecondBps

func (s *Statistic) SetHighestLastSecondBps(b uint64)

func (*Statistic) SetHighestLastTenMinutesBps

func (s *Statistic) SetHighestLastTenMinutesBps(b uint64)

func (*Statistic) SetLastHourBps

func (s *Statistic) SetLastHourBps(b uint64)

func (*Statistic) SetLastMinuteBps

func (s *Statistic) SetLastMinuteBps(b uint64)

func (*Statistic) SetLastSecondBps

func (s *Statistic) SetLastSecondBps(b uint64)

func (*Statistic) SetLastTenMinutesBps

func (s *Statistic) SetLastTenMinutesBps(b uint64)

func (*Statistic) SetLatency

func (s *Statistic) SetLatency(l int64)

func (*Statistic) SetTotalDownload

func (s *Statistic) SetTotalDownload(b uint64)

func (*Statistic) SetTotalUploaded

func (s *Statistic) SetTotalUploaded(b uint64)

func (*Statistic) Tick

func (s *Statistic) Tick()

type TCPOutboundHandler

type TCPOutboundHandler func(net.Conn, []byte, string) error

type TotalStatistic

type TotalStatistic struct {
	// contains filtered or unexported fields
}

func (*TotalStatistic) AddDownload

func (ts *TotalStatistic) AddDownload(b uint64)

func (*TotalStatistic) AddUpload

func (ts *TotalStatistic) AddUpload(b uint64)

func (*TotalStatistic) GetDownload

func (ts *TotalStatistic) GetDownload() uint64

func (*TotalStatistic) GetUpload

func (ts *TotalStatistic) GetUpload() uint64

func (*TotalStatistic) ResetDownload

func (ts *TotalStatistic) ResetDownload() uint64

func (*TotalStatistic) ResetUpload

func (ts *TotalStatistic) ResetUpload() uint64

func (*TotalStatistic) SetDownload

func (ts *TotalStatistic) SetDownload(b uint64)

func (*TotalStatistic) SetUpload

func (ts *TotalStatistic) SetUpload(b uint64)

type UDPOutboundHandler

type UDPOutboundHandler func(net.PacketConn, []byte, string) error

type WebsocketMessage

type WebsocketMessage struct {
	Cmd    int    `json:"cmd"`
	WParam string `json:"wparam"`
	LParam string `json:"lparam"`
}

Directories

Path Synopsis
Provides leaky buffer, based on the example in Effective Go.
Provides leaky buffer, based on the example in Effective Go.

Jump to

Keyboard shortcuts

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