utils

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: BSD-3-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const BufSize = 1 << 12
View Source
const (
	TLSHeaderLength = 5
)

Variables

This section is empty.

Functions

func FreeBytes

func FreeBytes(b []byte)

func GetExtensionBlock added in v1.1.17

func GetExtensionBlock(data []byte) ([]byte, error)

func GetGID added in v1.1.14

func GetGID() uint64

func GetSNBlock added in v1.1.17

func GetSNBlock(data []byte) ([]byte, error)

func GetSNIBlock added in v1.1.17

func GetSNIBlock(data []byte) ([]byte, error)

func NewBytes

func NewBytes(size int) []byte

func ParseHost added in v1.1.17

func ParseHost(data []byte) string

func SetBufferPool

func SetBufferPool(p *sync.Pool)

Types

type LogLevel

type LogLevel uint8
const (
	DEBUG LogLevel = iota
	INFO
	WARN
	ERROR
)

type LogOutputFunc

type LogOutputFunc func(string2 string, args ...any)

type Logger

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

func LogInst

func LogInst() *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(msg string, args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(msg string, args ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(msg string, args ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(msg string, args ...interface{})

func (*Logger) InitParam

func (l *Logger) InitParam(level LogLevel, of LogOutputFunc)

func (*Logger) SetLevel

func (l *Logger) SetLevel(level LogLevel)

func (*Logger) SetOutput

func (l *Logger) SetOutput(oFunc LogOutputFunc)

func (*Logger) Warnf

func (l *Logger) Warnf(msg string, args ...interface{})

Jump to

Keyboard shortcuts

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