part

package module
v0.28.20241212155801 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 23 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
	WarnMsg
	AcceptMsg
	DenyMsg
	LisnMsg
	ClosMsg
)

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 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 Logf

func Logf() *logl

func MasterDomain added in v0.3.36

func MasterDomain(url_s string) (string, error)

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 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