profile

package
v0.0.0-...-4b6388e Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2020 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

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 Role

type Role struct {
	// 角色名称
	Name string `json:"name"`
	// 角色描述
	Description string `json:"description"`
	// 创建时间
	CreateTime string `json:"createTime"`
	// 更新时间
	UpdateTime string `json:"updateTime"`
}

type RoleInput

type RoleInput struct {
	// 角色名称
	Name string `json:"name"`
	// 角色描述
	Description string `json:"description"`
}

type RoleOperateInput

type RoleOperateInput struct {
	// 角色名称
	RoleName string `json:"roleName"`
	// 资源名称
	DataName string `json:"dataName"`
}

type SetUserInput

type SetUserInput struct {
	// 用户名
	Name *string `json:"name"`
	// 密码
	Passwd *string `json:"passwd"`
	// 用户描述
	Description *string `json:"description"`
}

type User

type User struct {
	// 用户名
	Name string `json:"name"`
	// 用户描述
	Description string `json:"description"`
	// 用户密码
	Password string `json:"password"`
	// 创建时间
	CreateTime string `json:"createTime"`
	// 更新时间
	UpdateTime string `json:"updateTime"`
}

type UserBelongInput

type UserBelongInput struct {
	// 用户名称
	UserName string `json:"userName"`
	// 角色名称
	RoleName string `json:"roleName"`
}

type UserInput

type UserInput struct {
	// 用户名
	Name string `json:"name"`
	// 密码
	Passwd string `json:"passwd"`
	// 用户描述
	Description string `json:"description"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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