api

package
v0.8.15 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: GPL-3.0 Imports: 7 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 DBody added in v0.8.2

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

type DeleteEventInfo added in v0.8.2

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

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, dbody DBody) ([]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 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() 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 MiddlewareData added in v0.8.2

type MiddlewareData struct {
	Ctx   context.Context
	Dbody DBody
}

type MiddlewareFunc added in v0.8.2

type MiddlewareFunc func(MiddlewareData) MiddlewareData

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