1 Star 0 Fork 0

DaMeng/Ent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
cmd
dialect
doc
entc
gen
integration
cascadelete
compose/gremlin-server
config
customid
edgefield
edgeschema
ent
gremlin
hooks
idtype
json
migrate
multischema
ent
migrations
versioned
enttest
friendship
group
hook
internal
schemaconfig.go
migrate
pet
predicate
runtime
schema
user
client.go
ent.go
entc.go
friendship.go
friendship_create.go
friendship_delete.go
friendship_query.go
friendship_update.go
generate.go
group.go
group_create.go
group_delete.go
group_query.go
group_update.go
mutation.go
pet.go
pet_create.go
pet_delete.go
pet_query.go
pet_update.go
runtime.go
tx.go
user.go
user_create.go
user_delete.go
user_query.go
user_update.go
README.md
multischema_test.go
privacy
template
README.md
docker-compose.yaml
entql_test.go
go.mod
go.sum
index_test.go
integration_test.go
relation_test.go
type_test.go
internal
load
entc.go
entql
examples
privacy
schema
.all-contributorsrc
.golangci.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
README_jp.md
README_kr.md
README_zh.md
ent.go
go.mod
go.sum
op_string.go
克隆/下载
schemaconfig.go 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
DaMeng 提交于 4个月前 . :tada:fork ent
// Copyright 2019-present Facebook Inc. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
// Code generated by ent, DO NOT EDIT.
package internal
import "context"
// SchemaConfig represents alternative schema names for all tables
// that can be passed at runtime.
type SchemaConfig struct {
Friendship string // Friendship table.
Group string // Group table.
GroupUsers string // Group-users->User table.
Pet string // Pet table.
User string // User table.
UserFollowing string // User-following->User table.
}
type schemaCtxKey struct{}
// SchemaConfigFromContext returns a SchemaConfig stored inside a context, or empty if there isn't one.
func SchemaConfigFromContext(ctx context.Context) SchemaConfig {
config, _ := ctx.Value(schemaCtxKey{}).(SchemaConfig)
return config
}
// NewSchemaConfigContext returns a new context with the given SchemaConfig attached.
func NewSchemaConfigContext(parent context.Context, config SchemaConfig) context.Context {
return context.WithValue(parent, schemaCtxKey{}, config)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/damengde/ent.git
git@gitee.com:damengde/ent.git
damengde
ent
Ent
90870c5ba095

搜索帮助