query

package
v0.0.0-...-0b846ed Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Kind    string
	Bolt    *bolt.DB
	Mongo   *mongo.Collection
	Context context.Context
	Cancel  context.CancelFunc
}

Collection struct

func NewCollection

func NewCollection(kind string) Collection

NewCollection returns a Collection struct and connects it to the DB based on 'kind'

func (Collection) Query

func (c Collection) Query(filter *Filter, result interface{}) error

Query runs the supplied filter against the configured storage

type Filter

type Filter struct {
	Name *string
	Tags *[]*string
}

Filter struct

type Params

type Params struct {
	Query         string
	OperationName string
	Variables     map[string]interface{}
}

Params is a graphql query struct

type Resolver

type Resolver struct{}

Resolver struct

func (*Resolver) Entry

func (*Resolver) Entry(filter *Filter) *types.EntryResolver

Entry returns a random entry

func (*Resolver) Thread

func (*Resolver) Thread(filter *Filter) *types.ThreadResolver

Thread returns a random thread

type Results

type Results struct {
	Thread types.Thread `json:"thread,omitempty"`
	Entry  types.Entry  `json:"entry,omitempty"`
}

Results is a Query result

func Query

func Query(params Params) (Results, *graphql.Response, error)

Query returns a graphql resolved entry

Jump to

Keyboard shortcuts

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