api

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Schema defined in init()

UserRoleType role of user

View Source
var Validator = validator.New()

Validator instance

Functions

func Handler

func Handler(c echo.Context) error

Handler expose graphql

func NewGraphQLContext

func NewGraphQLContext(c echo.Context, u *models.User) (ctx context.Context)

NewGraphQLContext graphql context

Types

type Context

type Context struct {
	EchoCtx echo.Context
	User    *models.User
}

Context graphql

func NewContext

func NewContext(c context.Context) (ctx Context)

NewContext create graphql context

func (*Context) EnsureIsAuthorized

func (c *Context) EnsureIsAuthorized(cb func(*models.User) bool)

EnsureIsAuthorized user is authorized

func (*Context) Panic

func (c *Context) Panic(code int, message string)

Panic error

func (*Context) Validate

func (c *Context) Validate(inputMap map[string]interface{}, s interface{}, cb func(err validator.FieldError) string)

Validate struct

Jump to

Keyboard shortcuts

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