api

package
v0.8.24 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: GPL-3.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddEventInfo added in v0.8.2

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

type AuthHeader added in v0.8.2

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

type DeleteEventInfo added in v0.8.2

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

type Directive added in v0.8.16

type Directive struct {
	Name      string                     `json:"name"`
	Arguments map[string]json.RawMessage `json:"arguments"`
}

type Event added in v0.8.2

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 ExecuterInterface added in v0.8.2

type ExecuterInterface interface {
	Resolve(ctx context.Context, request *Request) ([]byte, *LambdaError)
}

type HandlerFunc added in v0.8.2

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

type HttpResponseStatus added in v0.8.15

type HttpResponseStatus int

type InfoField added in v0.8.16

type InfoField struct {
	Field SelectionField `json:"field"`
}

type Lambda added in v0.8.2

type Lambda struct {
	Executor ExecuterInterface
}

func New added in v0.8.2

func New(executer ExecuterInterface) *Lambda

func (*Lambda) Route added in v0.8.2

func (l *Lambda) Route(w http.ResponseWriter, r *http.Request)

func (*Lambda) Serve added in v0.8.2

func (l *Lambda) Serve(wg *sync.WaitGroup) (*http.Server, error)

type LambdaError added in v0.8.10

type LambdaError struct {
	Underlying error
	Status     HttpResponseStatus
}

func (*LambdaError) Error added in v0.8.10

func (l *LambdaError) Error() string

type MiddlewareContext added in v0.8.16

type MiddlewareContext struct {
	Ctx     context.Context
	Request *Request
}

type MiddlewareFunc added in v0.8.2

type MiddlewareFunc func(MiddlewareContext) MiddlewareContext

type Request added in v0.8.16

type Request struct {
	AccessToken string                     `json:"X-Dgraph-AccessToken"`
	Args        map[string]json.RawMessage `json:"args"`
	Field       InfoField                  `json:"info"`
	AuthHeader  AuthHeader                 `json:"authHeader"`
	Resolver    string                     `json:"resolver"`
	Parents     json.RawMessage            `json:"parents"`
	Event       *Event                     `json:"event"`
}

type SelectionField added in v0.8.16

type SelectionField struct {
	Alias        string                     `json:"alias"`
	Name         string                     `json:"name"`
	Arguments    map[string]json.RawMessage `json:"arguments"`
	Directives   []Directive                `json:"directives"`
	SelectionSet []SelectionField           `json:"slectionSet"`
}

type UpdateEventInfo added in v0.8.2

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

Jump to

Keyboard shortcuts

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