1 Star 0 Fork 0

ichub / goconfig

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
reflect_tag.go 682 Bytes
一键复制 编辑 原始数据 按行查看 历史
leijmdas 提交于 2024-04-01 14:32 . add
package reflectutils
import "strings"
// Id int32 `env:"${web.server.name}"
// gorm:"column:id;type:int(11);PRIMARY_KEY;comment:”"
// json:"id"`
type ReflectTag struct {
Tag string //env gorm json
Field string //id
TagName string //${web.server.name}
TagValue string //web.server.com
}
func NewReflectTag() *ReflectTag {
return &ReflectTag{}
}
func (this *ReflectTag) ParseTag(tagstr string) *ReflectTag {
tags := strings.Split(tagstr, ":")
if len(tags) > 1 {
this.Tag = tags[1]
}
return this
}
func (this *ReflectTag) ParseEnv(tagstr string) *ReflectTag {
tags := strings.Split(tagstr, ":")
if len(tags) > 1 {
this.Tag = tags[1]
}
return this
}
1
https://gitee.com/ichub/goconfig.git
git@gitee.com:ichub/goconfig.git
ichub
goconfig
goconfig
v1.0.407

搜索帮助