common

package
v0.0.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicString     = "GoV1"
	SSHMagicString  = "SSHV1"
	HttpMagicString = "HTTPV1"
)

Variables

View Source
var HttpMagicBytes = []byte(HttpMagicString)
View Source
var MagicBytes = []byte(MagicString)
View Source
var NewLineByte = byte('\n')
View Source
var NewLineBytes = []byte{NewLineByte}
View Source
var SSHMagicBytes = []byte(SSHMagicString)
View Source
var SeparatorBytes = []byte(" ")

Functions

func ClientIP

func ClientIP(conn net.Conn) string

func CopyDate

func CopyDate(dst io.Writer, src io.Reader) error

func GetHostname

func GetHostname() string

func LocalPrivateIPV4

func LocalPrivateIPV4() (net.IP, error)

func NewYamuxConfig

func NewYamuxConfig() *yamux.Config

func TcpAddr

func TcpAddr(addrStr string) (*net.TCPAddr, error)

func VerifyMagicStrConnection

func VerifyMagicStrConnection(conn net.Conn) error

func VerifySSHMagicStrConnection

func VerifySSHMagicStrConnection(conn net.Conn) error

Types

type Validator

type Validator interface {
	// Validate validates the given data.
	Validate() error
}

type WaitGroup

type WaitGroup struct {
	sync.WaitGroup
}

func (*WaitGroup) WaitFunc

func (w *WaitGroup) WaitFunc(f func())

Jump to

Keyboard shortcuts

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