common

package
v0.0.0-...-daaad2c Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: GPL-3.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

View Source
const (
	DEFAULT_IP_ADDRESS        string = "0.0.0.0"
	DEFAULT_CLIENT_IP_ADDRESS string = "127.0.0.1"
	DEFAULT_PORT              string = "49022"
)

Variables

View Source
var (
	DEFAULT_TIMEOUT time.Duration = 5 * time.Second
)

Functions

func Read

func Read(conn *tls.Conn) ([]byte, error)

func ReadString

func ReadString(conn *tls.Conn) (string, error)

func ReadStringBuffer

func ReadStringBuffer(buffSize int, conn *tls.Conn) (string, error)

func ReadStringBufferTimeout

func ReadStringBufferTimeout(buffSize int, conn *tls.Conn, timeout time.Duration) (string, error)

func ReadStringTimeout

func ReadStringTimeout(conn *tls.Conn, timeout time.Duration) (string, error)

func ReadTimeout

func ReadTimeout(conn *tls.Conn, timeout time.Duration) ([]byte, error)

func Write

func Write(value []byte, conn *tls.Conn) (int, error)

func WriteString

func WriteString(value string, conn *tls.Conn) (int, error)

Types

type CertificateKeyPair

type CertificateKeyPair struct {
	Cert string
	Key  string
}

type Sender

type Sender interface {
	SendMessage(conn *tls.Conn, params ...interface{}) error
	SetLogger(logger log.Logger)
	Helper() string
}

type TCPClient

type TCPClient interface {
	Open(insecureSkipVerify bool) error

	ServerOS() string

	IsOpen() bool

	Send(message bytes.Buffer) error

	SendText(message string) error

	ApplyCommand(command string, params ...interface{}) error

	ReadAnswer() (string, error)

	ReadDataPack() ([]byte, error)

	GetHelp() []string

	Clone() TCPClient

	Close() error
}

Jump to

Keyboard shortcuts

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