util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ZreoMessageId = nson.MessageId(make([]byte, 12))

Functions

func GetU32

func GetU32(b []byte, pos int) uint32

func LoadClientCert

func LoadClientCert(caFile, certFile, keyFile, serverName string, insecureSkipVerify bool) (*tls.Config, error)

func LoadServerCert

func LoadServerCert(caFile, certFile, keyFile string) (*tls.Config, error)

func MessageIdIsZero

func MessageIdIsZero(id nson.MessageId) bool

func ParseDate

func ParseDate(value string) (time.Time, error)

func ParseTime

func ParseTime(value string) (time.Time, error)

func RandString

func RandString(length int) string

func RandomID

func RandomID() string

func ReadNsonBytes

func ReadNsonBytes(reader io.Reader) ([]byte, error)

func ReadNsonMessage

func ReadNsonMessage(stream quic.Stream) (nson.Message, error)

func TimeFormat

func TimeFormat(t time.Time) string

func TryConvertTimeZone

func TryConvertTimeZone(before string) string

func WriteNsonMessage

func WriteNsonMessage(stream quic.Stream, message nson.Message) error

Types

type MyTime

type MyTime time.Time

func (MyTime) MarshalText

func (myT MyTime) MarshalText() (data []byte, err error)

func (*MyTime) UnmarshalText

func (myT *MyTime) UnmarshalText(text []byte) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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