types

package
v0.0.0-...-6ec5f38 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MulanPSL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByteSlice

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

func NewByteSlice

func NewByteSlice(b []byte) *ByteSlice

func (*ByteSlice) Append

func (b *ByteSlice) Append(a *ByteSlice) *ByteSlice

Append appends a's data to b's data (b = b + a).

func (*ByteSlice) AppendByte

func (b *ByteSlice) AppendByte(c byte) *ByteSlice

func (*ByteSlice) AppendBytes

func (b *ByteSlice) AppendBytes(a []byte) *ByteSlice

func (*ByteSlice) AppendFloat32

func (b *ByteSlice) AppendFloat32(f float32, format byte, precision int) *ByteSlice

func (*ByteSlice) AppendFloat64

func (b *ByteSlice) AppendFloat64(f float64, format byte, precision int) *ByteSlice

func (*ByteSlice) AppendGenerics

func (b *ByteSlice) AppendGenerics(appenders ...ByteSliceAppender) *ByteSlice

AppendGenerics calls AppendTo of appenders one by one to b's data. To generate AppendTo functions quickly and automatically, use "gen-bsa".

func (*ByteSlice) AppendInt

func (b *ByteSlice) AppendInt(i int) *ByteSlice

func (*ByteSlice) AppendInt16

func (b *ByteSlice) AppendInt16(i int16) *ByteSlice

func (*ByteSlice) AppendInt32

func (b *ByteSlice) AppendInt32(i int32) *ByteSlice

func (*ByteSlice) AppendInt64

func (b *ByteSlice) AppendInt64(i int64) *ByteSlice

func (*ByteSlice) AppendInt8

func (b *ByteSlice) AppendInt8(i int8) *ByteSlice

func (*ByteSlice) AppendPointer

func (b *ByteSlice) AppendPointer(p uintptr) *ByteSlice

AppendPointer appends the hexadecimal address of p with a "0x" prefix. To append a pointer of struct or other complex data structure, implement ByteSliceAppender or Stringer and use AppendGenerics.

func (*ByteSlice) AppendRune

func (b *ByteSlice) AppendRune(r rune) *ByteSlice

func (*ByteSlice) AppendString

func (b *ByteSlice) AppendString(s string) *ByteSlice

func (ByteSlice) AppendTo

func (b ByteSlice) AppendTo(b1 *ByteSlice)

AppendTo appends b's data to b1's data (b1 = b1 + b). It implements BSA.

func (*ByteSlice) AppendUint

func (b *ByteSlice) AppendUint(i uint) *ByteSlice

func (*ByteSlice) AppendUint16

func (b *ByteSlice) AppendUint16(i uint16) *ByteSlice

func (*ByteSlice) AppendUint32

func (b *ByteSlice) AppendUint32(i uint32) *ByteSlice

func (*ByteSlice) AppendUint64

func (b *ByteSlice) AppendUint64(i uint64) *ByteSlice

func (*ByteSlice) AppendUint8

func (b *ByteSlice) AppendUint8(i uint8) *ByteSlice

func (ByteSlice) Bytes

func (b ByteSlice) Bytes() []byte

Bytes returns b.data. It is NOT a copy, so the result will be changed after b modified.

func (ByteSlice) Cap

func (b ByteSlice) Cap() int

func (ByteSlice) Len

func (b ByteSlice) Len() int

func (ByteSlice) ReadCloser

func (b ByteSlice) ReadCloser() io.ReadCloser

ReadCloser creates an io.ReadCloser, but Close does nothing.

func (ByteSlice) Reader

func (b ByteSlice) Reader() io.Reader

Reader creates an io.Reader for Read.

func (*ByteSlice) Reset

func (b *ByteSlice) Reset()

func (ByteSlice) String

func (b ByteSlice) String() string

String implements Stringer.

type ByteSliceAppender

type ByteSliceAppender interface {
	AppendTo(*ByteSlice)
}

type CommonError

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

func Error

func Error(e error) CommonError

func (CommonError) AppendTo

func (e CommonError) AppendTo(b *ByteSlice)

func (CommonError) String

func (e CommonError) String() string

type CommonTime

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

func Time

func Time(t time.Time) CommonTime

func Timef

func Timef(t time.Time, format string) CommonTime

func (CommonTime) AppendTo

func (t CommonTime) AppendTo(b *ByteSlice)

func (CommonTime) String

func (t CommonTime) String() string

type Duration

type Duration int64

func (Duration) AppendTo

func (d Duration) AppendTo(b *ByteSlice)

func (Duration) String

func (d Duration) String() string

type F32

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

func Float32

func Float32(f float32) F32

func Float32f

func Float32f(f float32, format byte, precision int) F32

func (F32) AppendTo

func (f F32) AppendTo(b *ByteSlice)

func (F32) String

func (f F32) String() string

type F64

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

func Float64

func Float64(f float64) F64

func Float64f

func Float64f(f float64, format byte, precision int) F64

func (F64) AppendTo

func (f F64) AppendTo(b *ByteSlice)

func (F64) String

func (f F64) String() string

type Int

type Int int

func (Int) AppendTo

func (i Int) AppendTo(b *ByteSlice)

func (Int) String

func (i Int) String() string

type Int16

type Int16 int16

func (Int16) AppendTo

func (i Int16) AppendTo(b *ByteSlice)

func (Int16) String

func (i Int16) String() string

type Int32

type Int32 int32

func (Int32) AppendTo

func (i Int32) AppendTo(b *ByteSlice)

func (Int32) String

func (i Int32) String() string

type Int64

type Int64 int64

func Timestamp

func Timestamp(t time.Time) Int64

func TimestampMicro

func TimestampMicro(t time.Time) Int64

func TimestampMilli

func TimestampMilli(t time.Time) Int64

func TimestampNano

func TimestampNano(t time.Time) Int64

func (Int64) AppendTo

func (i Int64) AppendTo(b *ByteSlice)

func (Int64) String

func (i Int64) String() string

type Int8

type Int8 int8

func (Int8) AppendTo

func (i Int8) AppendTo(b *ByteSlice)

func (Int8) String

func (i Int8) String() string

type Interface

type Interface interface {
	ByteSliceAppender
	Stringer
}

type Stringer

type Stringer interface {
	String() string
}

type Uint

type Uint uint

func (Uint) AppendTo

func (i Uint) AppendTo(b *ByteSlice)

func (Uint) String

func (i Uint) String() string

type Uint16

type Uint16 uint16

func (Uint16) AppendTo

func (i Uint16) AppendTo(b *ByteSlice)

func (Uint16) String

func (i Uint16) String() string

type Uint32

type Uint32 uint32

func (Uint32) AppendTo

func (i Uint32) AppendTo(b *ByteSlice)

func (Uint32) String

func (i Uint32) String() string

type Uint64

type Uint64 uint64

func (Uint64) AppendTo

func (i Uint64) AppendTo(b *ByteSlice)

func (Uint64) String

func (i Uint64) String() string

type Uint8

type Uint8 uint8

func (Uint8) AppendTo

func (i Uint8) AppendTo(b *ByteSlice)

func (Uint8) String

func (i Uint8) String() string

Jump to

Keyboard shortcuts

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