Documentation ¶
Index ¶
- Variables
- func AuthErrorHandler(w http.ResponseWriter, ctx context.Context, err error)
- func Errorf(ctx context.Context, format string, args ...interface{}) *errors.QueryError
- func LoggingMiddleware(next http.Handler) http.Handler
- func MergeSchemas(first string, second string) string
- func MustProtoToOpaqueCursor(entity proto.Message, entityTag string) string
- func NewCORSMiddleware() mux.MiddlewareFunc
- func RegisterSchema(schemaPrefix, schemaName string, schemaData []byte)
- func Status(ctx context.Context, code codes.Code, message string) *errors.QueryError
- func UnmarshalCursorProto(opaqued string, entity proto.Message) error
- func UnwrapError(ctx context.Context, err error) *errors.QueryError
- type EndpointServer
- type Keyable
- type MultiRouterClient
- type OpencensusTracer
- func (t *OpencensusTracer) TraceField(ctx context.Context, label, typeName, fieldName string, trivial bool, ...) (context.Context, gqtrace.TraceFieldFinishFunc)
- func (t *OpencensusTracer) TraceQuery(ctx context.Context, queryString string, operationName string, ...) (context.Context, gqtrace.TraceQueryFinishFunc)
- type Paginator
- type Pagineable
- type PagineableStrings
- type SchemaSelector
- type Schemas
- type Server
Constants ¶
This section is empty.
Variables ¶
View Source
var SchemaRegistry = map[string][]byte{}
Functions ¶
func AuthErrorHandler ¶
func AuthErrorHandler(w http.ResponseWriter, ctx context.Context, err error)
func Errorf ¶
func Errorf(ctx context.Context, format string, args ...interface{}) *errors.QueryError
func MergeSchemas ¶
MergeSchemas is a poor man way of merging some specific GraphQL types together to form a single schemas.
The algorithm simply reads the schema and look for the pattern `type Query {(.*)}` and `type Subscription {(.*)}`, collecting them along the way and removing from the actual buffer.
Once the full schema has been processed, we simply append a `type Query { ... }` node with the content (regexp sub-match) of the various collected queries in the first pass, same for `Subscription`.
This creates a final `Query` and `Subscription` type of the collected merged elements.
**Important** This is regexp based, so the current drawback of this technique
is that the inner sub-match content must not contain a `{ }` pair. This is easy to achieve and maintain.
func MustProtoToOpaqueCursor ¶
func NewCORSMiddleware ¶
func NewCORSMiddleware() mux.MiddlewareFunc
func RegisterSchema ¶
func UnwrapError ¶
func UnwrapError(ctx context.Context, err error) *errors.QueryError
Types ¶
type EndpointServer ¶
type EndpointServer struct {
// contains filtered or unexported fields
}
func NewEndpointServer ¶
func NewEndpointServer(schema *graphql.Schema, authenticator authenticator.Authenticator) *EndpointServer
func (*EndpointServer) Execute ¶
func (s *EndpointServer) Execute(req *pbgraphql.Request, stream pbgraphql.GraphQL_ExecuteServer) error
type MultiRouterClient ¶
func NewMultiRouterClient ¶
func NewMultiRouterClient(v1Client pbsearch.RouterClient, v2Client pbsearch.RouterClient) *MultiRouterClient
func (*MultiRouterClient) StreamMatches ¶
func (m *MultiRouterClient) StreamMatches(ctx context.Context, in *pbsearch.RouterRequest, opts ...grpc.CallOption) (pbsearch.Router_StreamMatchesClient, error)
type OpencensusTracer ¶
type OpencensusTracer struct { }
func (*OpencensusTracer) TraceField ¶
func (t *OpencensusTracer) TraceField( ctx context.Context, label, typeName, fieldName string, trivial bool, args map[string]interface{}, ) (context.Context, gqtrace.TraceFieldFinishFunc)
func (*OpencensusTracer) TraceQuery ¶
func (t *OpencensusTracer) TraceQuery( ctx context.Context, queryString string, operationName string, variables map[string]interface{}, varTypes map[string]*introspection.Type, ) (context.Context, gqtrace.TraceQueryFinishFunc)
type Paginator ¶
type Paginator struct { HasPreviousPage bool HasNextPage bool // contains filtered or unexported fields }
func NewPaginator ¶
func (*Paginator) Paginate ¶
func (p *Paginator) Paginate(results Pagineable) Pagineable
type Pagineable ¶
type Pagineable interface { Length() int IsEqual(index int, key string) bool Append(slice Pagineable, index int) Pagineable }
type PagineableStrings ¶
type PagineableStrings []string
func (PagineableStrings) Append ¶
func (p PagineableStrings) Append(slice Pagineable, index int) Pagineable
func (PagineableStrings) Length ¶
func (p PagineableStrings) Length() int
type SchemaSelector ¶
type SchemaSelector interface { SchemaID() schemaID String() string }
func WithAlpha ¶
func WithAlpha() SchemaSelector
type Schemas ¶
type Schemas struct {
// contains filtered or unexported fields
}
func NewSchemas ¶
func (*Schemas) GetSchema ¶
func (s *Schemas) GetSchema(selectors ...SchemaSelector) *graphql.Schema
Source Files ¶
Click to show internal directories.
Click to hide internal directories.