part

package module
v0.28.20240501061452 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 27 Imported by: 7

README

part

test PkgGoDev


LICENSE

使用了以下项目,十分感谢


介绍

自己编写/收集的一些go组件,增加复用

buf map变量的save,load,get,set

get 爬虫

session 会话(超时)验证

msgq 消息队列

...

Documentation

Index

Constants

View Source
const (
	ErrorMsg = iota
	AcceptMsg
	DenyMsg
	LisnMsg
)

Variables

View Source
var (
	ErrDnsNoAnswer      = errors.New("ErrDnsNoAnswer")
	ErrNetworkNoSupport = errors.New("ErrNetworkNoSupport")
	ErrUdpOverflow      = errors.New("ErrUdpOverflow") // default:1500 set higher pkgSize at NewUdpListener
)

Functions

func Checkfile

func Checkfile() *checkfile

func Exec

func Exec() *lexec

func File

func File() *file

func FileMove added in v0.3.36

func FileMove(src, trg string) error

func Forward added in v0.3.36

func Forward(targetaddr, listenaddr string, acceptCIDRs []string) (closef func(), msg_chan chan ForwardMsg)

func Json

func Json() *json

func Logf

func Logf() *logl

func MasterDomain added in v0.3.36

func MasterDomain(url_s string) (string, error)

func Md5

func Md5() *md5l

func Net

func Net() *netl

func NewUdpConn added in v0.28.20240414033603

func NewUdpConn(per []byte, remoteAdd *net.UDPAddr, conn *net.UDPConn) *udpConn

func NewUdpListener added in v0.28.20240414033603

func NewUdpListener(network, listenaddr string, pkgSize ...int) (*udpLis, error)

func RZip

func RZip() *rZip

func Rand

func Rand() *random

func Zip

func Zip() *lzip

Types

type ConnPool added in v0.28.20240414033603

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

func NewConnPool added in v0.28.20240414033603

func NewConnPool(size int, genConn func() *net.Conn) *ConnPool

func (*ConnPool) Get added in v0.28.20240414033603

func (t *ConnPool) Get(id string) (i net.Conn, putBack func())

type ConnPoolItem added in v0.28.20240414033603

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

type Filel

type Filel struct {
	File    string //src
	Loc     int64  //WriteOrRead loc ;0:rewrite Or read all;-1 write on end
	ReadNum int64
	Context []interface{} //Write string

	// wrap with encoder/decoder
	//https://pkg.go.dev/golang.org/x/text/encoding
	WrapWriter func(io.Writer) io.Writer
	// contains filtered or unexported fields
}

func (Filel) Write

func (t Filel) Write(b []byte) (int, error)

func (t Filel) Read(b []byte)(int,error){return t.read(b)}

type ForwardMsg added in v0.3.36

type ForwardMsg struct {
	Type int
	Msg  interface{}
}

when Type is ErrorMsg, Msg is set to error when Type is AcceptMsg, Msg is set to net.Addr when Type is DenyMsg, Msg is set to net.Addr when Type is LisnMsg, Msg is set to net.Addr

Jump to

Keyboard shortcuts

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