serializer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init 注册自定义序列化器

Types

type TrimSerializer

type TrimSerializer struct{}

TrimSerializer Trim序列化器 在从数据库读取时自动去除空格 用于解析char(n)类型字段

func (TrimSerializer) Scan

func (TrimSerializer) Scan(ctx context.Context, field *schema.Field, dst reflect.Value, dbValue interface{}) (err error)

Scan 实现了Serializer接口

func (TrimSerializer) Value

func (TrimSerializer) Value(ctx context.Context, field *schema.Field, dst reflect.Value, fieldValue interface{}) (interface{}, error)

Value 实现了Serializer接口

Jump to

Keyboard shortcuts

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