composter

package
v0.0.0-...-a6668d3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2017 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

Package composter is a graphql http server, and is responsible for defining the overall graphql schema.

Index

Constants

This section is empty.

Variables

View Source
var (
	UserStatusEnumType       *graphql.Enum
	TeamSubscriptionEnumType *graphql.Enum
	AggregationEnumType      *graphql.Enum

	InstanceType   *graphql.Object
	DbInstanceType *graphql.Object
	EcsServiceType *graphql.Object
	CheckType      *graphql.Object

	CheckInputType        *graphql.InputObject
	TeamInputType         *graphql.InputObject
	UserInputType         *graphql.InputObject
	UserFlagsInputType    *graphql.InputObject
	NotificationInputType *graphql.InputObject
	AggregationInputType  *graphql.InputObject
)
View Source
var JsonScalar *graphql.Scalar = graphql.NewScalar(graphql.ScalarConfig{
	Name:       "JsonRawMessage",
	Serialize:  coerceJson,
	ParseValue: coerceJson,
	ParseLiteral: func(valueAST ast.Value) interface{} {
		switch valueAST := valueAST.(type) {
		case *ast.StringValue:
			return valueAST.Value
		}
		return nil
	},
})

Functions

func GraphQLStructObject

func GraphQLStructObject(thing interface{}, name, description string) *graphql.Object

func UserPermittedFromContext

func UserPermittedFromContext(ctx context.Context, perm string, extra ...PermissionOp) (*schema.User, error)

Types

type Composter

type Composter struct {
	Schema      graphql.Schema
	AdminSchema graphql.Schema
	// contains filtered or unexported fields
}

func New

func New(resolver *resolver.Client) *Composter

func (*Composter) Compost

func (c *Composter) Compost(ctx context.Context, schema graphql.Schema) (*graphql.Result, error)

func (*Composter) StartHTTP

func (s *Composter) StartHTTP(addr string)

type GraphQLRequest

type GraphQLRequest struct {
	Query     string                 `json:"query"`
	Variables map[string]interface{} `json:"variables,omitempty"`
}

func (*GraphQLRequest) Validate

func (req *GraphQLRequest) Validate() error

type PermissionOp

type PermissionOp struct {
	// contains filtered or unexported fields
}

func (PermissionOp) Op

func (p PermissionOp) Op(user *schema.User, has error) error

type QueryContext

type QueryContext struct {
	Region string
	VpcId  string
}

Jump to

Keyboard shortcuts

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