10 Star 35 Fork 8

bigpigeon / toyorm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
toy_kernel.go 695 Bytes
一键复制 编辑 原始数据 按行查看 历史
bigpigeon 提交于 2018-12-10 22:01 . 1. update => v0.5.1
/*
* Copyright 2018. bigpigeon. All rights reserved.
* Use of this source code is governed by a MIT style
* license that can be found in the LICENSE file.
*/
package toyorm
import (
"io"
"reflect"
)
type CacheMeta struct {
TableName string
}
type ToyKernel struct {
debug bool
// map[model][container_field_name]
Dialect Dialect
Logger io.Writer
}
// TODO testing thread safe? if not add lock
func (t *ToyKernel) GetModel(val reflect.Value) *Model {
if val.Kind() != reflect.Struct {
panic(ErrInvalidModelType("invalid struct type " + val.Type().Name()))
}
name := ModelName(val)
return newModel(val, name)
}
func (t *ToyKernel) SetDebug(debug bool) {
t.debug = debug
}
Go
1
https://gitee.com/bigpigeon/toyorm.git
git@gitee.com:bigpigeon/toyorm.git
bigpigeon
toyorm
toyorm
master

搜索帮助