goutils

package module
v0.0.0-...-a46122a Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MaxSerialNumber = big.NewInt(0).SetBytes(bytes.Repeat([]byte{255}, 20))

Functions

func Cert

func Cert(hostname string, ca *x509.Certificate, pk *rsa.PrivateKey) (cert *tls.Certificate, err error)

func CreateFileNotExist

func CreateFileNotExist(filename string) (f *os.File, err error)

func GenerateCert

func GenerateCert(caname, pkname string) (ca *x509.Certificate, pk *rsa.PrivateKey, err error)

func InetAtoN

func InetAtoN(ip string) uint32

func InetNtoA

func InetNtoA(ip uint32) string

func InetNtoP

func InetNtoP(ip uint32) net.IP

func InetPtoA

func InetPtoA(ip net.IP) string

func LoadCert

func LoadCert(capath, pkpath string) (ca *x509.Certificate, pk *rsa.PrivateKey, err error)

func NewAuthority

func NewAuthority(name string) (ca *x509.Certificate, privateKey *rsa.PrivateKey, err error)

func Pipe

func Pipe(src, dst io.ReadWriteCloser)

func RandBytes

func RandBytes(length int) []byte

func RandString

func RandString(length int) string

func RepeatTimer

func RepeatTimer(d time.Duration, f func(), immediately bool)

func SplitHostPort

func SplitHostPort(hostport string) (host string, port int)

func SplitIPPort

func SplitIPPort(ipport string) (ip string, port int)

func WriteFile

func WriteFile(filename string, data []byte) (err error)

func XOR

func XOR(i, o, key []byte)

Types

type Repeater

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

func NewRepeater

func NewRepeater(d time.Duration, f func()) (repeater *Repeater)

func (*Repeater) Stop

func (self *Repeater) Stop()

type Timeout

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

func NewTimeout

func NewTimeout(duration time.Duration, f func()) (timeout *Timeout)

func (*Timeout) ChangeTime

func (self *Timeout) ChangeTime(duration time.Duration)

func (*Timeout) Stop

func (self *Timeout) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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