lang

package
v0.9.11 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 4 Imported by: 33

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64

type Base64 string

Base64 以字符串的形式表示一个 base64 格式的数据

func Base64FromBytes

func Base64FromBytes(data []byte) Base64

Base64FromBytes 把字节切片编码为 base64 字符串

func (Base64) Bytes

func (b Base64) Bytes() []byte

Bytes 转化为字节切片

func (Base64) String

func (b Base64) String() string

type ByteSlice

type ByteSlice []byte

ByteSlice 表示一个字节串切片

func NewByteSlice

func NewByteSlice(data []byte) ByteSlice

NewByteSlice 新建一个字节切片

func (ByteSlice) Base64

func (ba ByteSlice) Base64() Base64

Base64 转换为 Base64 字符串

func (ByteSlice) Bytes

func (ba ByteSlice) Bytes() []byte

Bytes 转换为字节切片

func (ByteSlice) Hex

func (ba ByteSlice) Hex() Hex

Hex 转换为十六进制字符串

func (ByteSlice) String

func (ba ByteSlice) String() string

type Hex

type Hex string

Hex 用字符串的形式表示一个十六进制数

func HexFromBytes

func HexFromBytes(data []byte) Hex

HexFromBytes 把字节切片转化为 Hex

func (Hex) Bytes

func (h Hex) Bytes() []byte

Bytes 转换为字节切片

func (Hex) String

func (h Hex) String() string

type Milliseconds added in v0.9.10

type Milliseconds int64

Milliseconds 以毫秒为单位表示时间长度

func NewMilliseconds added in v0.9.10

func NewMilliseconds(d time.Duration) Milliseconds

NewMilliseconds 把 Duration 转换为 Milliseconds

func (Milliseconds) Duration added in v0.9.10

func (value Milliseconds) Duration() time.Duration

Duration 转换为 Duration 形式

type Seconds added in v0.9.10

type Seconds int64

Seconds 以秒为单位表示时间长度

func NewSeconds added in v0.9.10

func NewSeconds(d time.Duration) Seconds

NewSeconds 把 Duration 转换为 Seconds

func (Seconds) Duration added in v0.9.10

func (value Seconds) Duration() time.Duration

Duration 转换为 Duration 形式

type Time

type Time int64

Time 用 int64 表示一个 unix 时间戳,单位是毫秒,基于 UTC_1970-01-01_00:00:00

func NewTime

func NewTime(t time.Time) Time

NewTime 根据 time.Time 创建时间戳

func Now

func Now() Time

Now 取当前时间戳

func (Time) Add added in v0.9.10

func (t Time) Add(d time.Duration) Time

Add 函数提供时间戳的加法,计算从 t 开始,经历 d 时间后,所在的时刻

func (Time) Int

func (t Time) Int() int64

Int 把时间戳转换为 int64 形式

func (Time) String

func (t Time) String() string

func (Time) Sub added in v0.9.10

func (t Time) Sub(t0 Time) time.Duration

Sub 函数提供时间戳的减法,计算 从 t0 开始,到 t 为止所经历的时间

func (Time) Time

func (t Time) Time() time.Time

Time 把时间戳转换为 time.Time 形式

type UUID added in v0.9.6

type UUID string

UUID like 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'

func NewUUID added in v0.9.6

func NewUUID(data []byte) UUID

NewUUID 新建UUID

func ParseUUID added in v0.9.6

func ParseUUID(str string) UUID

ParseUUID 解析UUID

func (UUID) Bytes added in v0.9.6

func (u UUID) Bytes() []byte

Bytes 转化为字节串形式

func (UUID) Normalize added in v0.9.6

func (u UUID) Normalize() UUID

Normalize 标准化 UUID

func (UUID) String added in v0.9.6

func (u UUID) String() string

type UUIDGenerator added in v0.9.7

type UUIDGenerator interface {
	Generate(params ...string) UUID
	GenerateWithMap(m map[string]string) UUID
}

UUIDGenerator 是 UUID 生成器的接口

Jump to

Keyboard shortcuts

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