lang

package module
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

lang

介绍

lang包,用于封装对应java基础数据类型

软件架构

软件架构说明

安装教程
  1. xxxx
  2. xxxx
  3. xxxx
使用说明
  1. xxxx
  2. xxxx
  3. xxxx
参与贡献
  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request
特技
  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean interface {
	Boolean() (bool, bool)
}

lang.Boolean Interface

Boolean接口, Boolean函数用于断言当前值为bool

type Bytes added in v1.0.8

type Bytes interface {
	Bytes() ([]byte, bool)
}

lang.Bytes Interface

Bytes接口, Bytes函数用于断言当前值为[]byte

type Double

type Double interface {
	Double() (float64, bool)
}

lang.Double Interface

Double接口, Double函数用于断言当前值为float64

type Formatter added in v1.0.8

type Formatter interface {
	Format(any) string
}

lang.Formatter Interface

Formatter接口, Format函数用于格式化当前值

type Getter added in v1.0.8

type Getter interface {
	Get() any
}

lang.Getter Interface

Getter接口, Get函数获取当前值

type Kind added in v1.0.8

type Kind uint8

lang.Kind

定义类型列表: lang.TEXT, lang.LONG, lang.DOUBLE, lang.TIME, lang.BOOLEAN, lang.BYTES

默认值为: lang.TEXT

const (
	TEXT Kind = iota
	LONG
	DOUBLE
	TIME
	BOOLEAN
	BYTES
)

类型常量列表

type Long

type Long interface {
	Long() (int64, bool) // (int64: 失败时默认返回0, bool: 断言成功标识)
}

lang.Long Interface

Long接口, Long函数用于断言当前值为int64

type Niler added in v1.0.8

type Niler interface {
	Nil() bool
}

lang.Niller Interface

Niler接口, 当前值为nil时,Nil函数返回true

type Object added in v1.0.8

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

Object Struct

Object结构体

func NewObject added in v1.0.8

func NewObject(args ...any) *Object

New函数

args: 根据传入类型,设置需要初始化的信息

func (*Object) Boolean added in v1.0.8

func (o *Object) Boolean() (bool, bool)

实现lang.Boolean接口, 用于获取boolean值

func (*Object) Bytes added in v1.0.8

func (o *Object) Bytes() ([]byte, bool)

实现lang.Bytes接口, 用于获取bytes值

func (*Object) Double added in v1.0.8

func (o *Object) Double() (float64, bool)

实现lang.Double接口, 用于获取double值

func (*Object) Format added in v1.0.8

func (o *Object) Format(v any) string

实现lang.Formatter接口, 作为缺省格式化函数

func (*Object) Get added in v1.0.8

func (o *Object) Get() any

实现lang.Getter接口, 用于获取当前值

func (*Object) Long added in v1.0.8

func (o *Object) Long() (int64, bool)

实现lang.Long接口, 用于获取long值

func (Object) MarshalJSON added in v1.0.8

func (o Object) MarshalJSON() ([]byte, error)

实现json.Marshaler接口, 用于处理JSON序列化

func (*Object) Nil added in v1.0.8

func (o *Object) Nil() bool

实现lang.Niler接口, 用于判断当前值是否为nil

func (*Object) Parse added in v1.0.8

func (o *Object) Parse(v any) (any, error)

实现lang.Parser接口, 作为缺省解析函数

func (*Object) Scan added in v1.0.8

func (o *Object) Scan(v any) error

实现sql.Scanner接口, 用于读取数据库值

func (*Object) Set added in v1.0.8

func (o *Object) Set(v any)

实现lang.Setter接口, 用于设置当前值

func (*Object) String added in v1.0.8

func (o *Object) String() string

实现fmt.Stringer接口, 用于进行字符串输出

func (*Object) Text added in v1.0.8

func (o *Object) Text() (string, bool)

实现lang.Text接口, 用于获取text值

func (*Object) Time added in v1.0.8

func (o *Object) Time() (time.Time, bool)

实现lang.Time接口, 用于获取time值

func (*Object) UnmarshalJSON added in v1.0.8

func (o *Object) UnmarshalJSON(v []byte) error

实现json.Unmarshaler接口, 用于进行JSON反序列化

func (*Object) Value added in v1.0.8

func (o *Object) Value() (driver.Value, error)

实现sql.Valuer接口, 用于写入数据库值

type Parser added in v1.0.8

type Parser interface {
	Parse(any) (any, error)
}

lang.Parser Interface

Parser接口, Parse函数用于解析当前参数

type Setter added in v1.0.8

type Setter interface {
	Set(any)
}

lang.Setter Interface

Setter接口, Set函数设置当前值

type Text added in v1.0.8

type Text interface {
	Text() (string, bool)
}

lang.Text Interface

Text接口, Text函数用于断言当前值为string

type Time added in v1.0.8

type Time interface {
	Time() (time.Time, bool)
}

lang.Time Interface

Time接口, Time函数用于断言当前值为time.Time

Jump to

Keyboard shortcuts

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