Documentation ¶
Index ¶
- func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
- type ComplexityRoot
- type Config
- type Data
- type DirectiveRoot
- type MutationResolver
- type QueryResolver
- type Resolver
- type ResolverRoot
- type Role
- type RoleInput
- type RoleOperateInput
- type SetUserInput
- type User
- type UserBelongInput
- type UserInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewExecutableSchema ¶
func NewExecutableSchema(cfg Config) graphql.ExecutableSchema
NewExecutableSchema creates an ExecutableSchema from the ResolverRoot interface.
Types ¶
type ComplexityRoot ¶
type ComplexityRoot struct { Data struct { CreateTime func(childComplexity int) int Description func(childComplexity int) int Mode func(childComplexity int) int Name func(childComplexity int) int Service func(childComplexity int) int Style func(childComplexity int) int UpdateTime func(childComplexity int) int } Mutation struct { CreateRole func(childComplexity int, input RoleInput) int CreateRoleOperate func(childComplexity int, input RoleOperateInput) int CreateUser func(childComplexity int, input UserInput) int CreateUserBelong func(childComplexity int, input UserBelongInput) int DeleteRole func(childComplexity int, name string) int DeleteRoleOperate func(childComplexity int, input RoleOperateInput) int DeleteUser func(childComplexity int, name string) int DeleteUserBelong func(childComplexity int, input UserBelongInput) int UpdateRole func(childComplexity int, input RoleInput) int UpdateUser func(childComplexity int, input SetUserInput) int } Query struct { Datas func(childComplexity int, name *string, mode *string, style *string, service *string) int RoleOperate func(childComplexity int, roleName string) int Roles func(childComplexity int, name *string) int UserBelong func(childComplexity int, userName string) int Users func(childComplexity int, name *string) int } Role struct { CreateTime func(childComplexity int) int Description func(childComplexity int) int Name func(childComplexity int) int UpdateTime func(childComplexity int) int } User struct { CreateTime func(childComplexity int) int Description func(childComplexity int) int Name func(childComplexity int) int Password func(childComplexity int) int UpdateTime func(childComplexity int) int } }
type Config ¶
type Config struct { Resolvers ResolverRoot Directives DirectiveRoot Complexity ComplexityRoot }
type Data ¶
type Data struct { // 资源名称 Name string `json:"name"` // 资源描述 Description string `json:"description"` // 资源类型 Style string `json:"style"` // 所属服务 Service string `json:"service"` // 权限(w、r) Mode string `json:"mode"` // 创建时间 CreateTime string `json:"createTime"` // 更新时间 UpdateTime string `json:"updateTime"` }
type DirectiveRoot ¶
type DirectiveRoot struct { }
type MutationResolver ¶
type MutationResolver interface { CreateRole(ctx context.Context, input RoleInput) (*Role, error) UpdateRole(ctx context.Context, input RoleInput) (*Role, error) DeleteRole(ctx context.Context, name string) (bool, error) CreateUser(ctx context.Context, input UserInput) (*User, error) UpdateUser(ctx context.Context, input SetUserInput) (*User, error) DeleteUser(ctx context.Context, name string) (bool, error) CreateUserBelong(ctx context.Context, input UserBelongInput) (bool, error) DeleteUserBelong(ctx context.Context, input UserBelongInput) (bool, error) CreateRoleOperate(ctx context.Context, input RoleOperateInput) (bool, error) DeleteRoleOperate(ctx context.Context, input RoleOperateInput) (bool, error) }
type QueryResolver ¶
type QueryResolver interface { Roles(ctx context.Context, name *string) ([]*Role, error) Users(ctx context.Context, name *string) ([]*User, error) Datas(ctx context.Context, name *string, mode *string, style *string, service *string) ([]*Data, error) UserBelong(ctx context.Context, userName string) ([]*Role, error) RoleOperate(ctx context.Context, roleName string) ([]*Data, error) }
type Resolver ¶
type Resolver struct{}
func (*Resolver) Mutation ¶
func (r *Resolver) Mutation() MutationResolver
func (*Resolver) Query ¶
func (r *Resolver) Query() QueryResolver
type ResolverRoot ¶
type ResolverRoot interface { Mutation() MutationResolver Query() QueryResolver }
type RoleOperateInput ¶
type SetUserInput ¶
type UserBelongInput ¶
Click to show internal directories.
Click to hide internal directories.