gql

package module
v0.0.0-...-49d8a14 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: LGPL-3.0 Imports: 33 Imported by: 0

README

gql.sr.ht

This is a support library which houses code common to each *.sr.ht GraphQL API implementation.

NOTICE: this library is obsolete and due to be deleted. See core-go instead.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Access

func Access(ctx context.Context, obj interface{}, next graphql.Resolver,
	scope string, kind string) (interface{}, error)

func EmailRecover

func EmailRecover(config ini.File, debug bool, srv string) graphql.RecoverFunc

Provides a graphql.RecoverFunc which will print the stack trace, and if debug mode is not enabled, email it to the administrator.

func Internal

func Internal(ctx context.Context, obj interface{},
	next graphql.Resolver) (interface{}, error)

func ListenAndServe

func ListenAndServe(router chi.Router)

Runs the API server.

func LoadConfig

func LoadConfig(defaultAddr string) ini.File

Loads the application configuration, reads options from the command line, and initializes some internals based on these results.

func MakeRouter

func MakeRouter(service string, conf ini.File, schema graphql.ExecutableSchema,
	middlewares ...func(http.Handler) http.Handler) chi.Router

Prepares a router with the sr.ht API middleware pre-configured. This connects to PostgreSQL to rig up the database middlewares.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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