resolver

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEventInfo added in v0.7.0

type AddEventInfo struct {
	RootUIDs []string                 `json:"rootUIDs"`
	Input    []map[string]interface{} `json:"input"`
}

type AuthHeader added in v0.5.0

type AuthHeader struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type DBody added in v0.5.0

type DBody struct {
	AccessToken string                   `json:"X-Dgraph-AccessToken"`
	Args        map[string]interface{}   `json:"args"`
	AuthHeader  AuthHeader               `json:"authHeader"`
	Resolver    string                   `json:"resolver"`
	Parents     []map[string]interface{} `json:"parents"`
	Event       Event                    `json:"event"`
}

type DeleteEventInfo added in v0.7.0

type DeleteEventInfo struct {
	RootUIDs []string `json:"rootUIDs"`
}

type Event added in v0.7.0

type Event struct {
	TypeName  string          `json:"__typename"`
	CommitTs  uint64          `json:"commitTs"`
	Operation string          `json:"operation"`
	Add       AddEventInfo    `json:"add"`
	Update    UpdateEventInfo `json:"update"`
	Delete    DeleteEventInfo `json:"delete"`
}

type HandlerFunc

type HandlerFunc func(ctx context.Context, input []byte, parents []byte, authHeader AuthHeader) (interface{}, error)

type MiddlewareFunc

type MiddlewareFunc func(HandlerFunc) HandlerFunc

type Resolver

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

func NewResolver

func NewResolver() *Resolver

func (*Resolver) Resolve

func (r *Resolver) Resolve(ctx context.Context, dbody *DBody) ([]byte, error)

func (*Resolver) ResolveFunc

func (r *Resolver) ResolveFunc(resolver string, handlerFunc HandlerFunc)

func (*Resolver) Use

func (r *Resolver) Use(middleware MiddlewareFunc)

func (*Resolver) UseOnResolver added in v0.6.0

func (r *Resolver) UseOnResolver(resolver string, middleware MiddlewareFunc)

func (*Resolver) WebHookFunc added in v0.7.0

func (r *Resolver) WebHookFunc(typeName string, webhookFunc WebHookFunc)

type ResolverMiddlewareFunc added in v0.6.0

type ResolverMiddlewareFunc struct {
	Resolver string
	// contains filtered or unexported fields
}

type UpdateEventInfo added in v0.7.0

type UpdateEventInfo struct {
	RootUIDs    []string               `json:"rootUIDs"`
	SetPatch    map[string]interface{} `json:"setPatch"`
	RemovePatch map[string]interface{} `json:"removePatch"`
}

type WebHookFunc added in v0.7.0

type WebHookFunc func(ctx context.Context, event Event) error

Jump to

Keyboard shortcuts

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