Documentation ¶
Index ¶
Constants ¶
View Source
const ( ContentTypeJSON = "application/json" ContentTypeGraphQL = "application/graphql" ContentTypeFormURLEncoded = "application/x-www-form-urlencoded" ContentTypeMultipartFormData = "multipart/form-data" )
Variables ¶
View Source
var (
MaxUploadMemorySize = int64(1024 * 1024 * 10)
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type EntryFn ¶ added in v0.2.7
type EntryFn func(ctx context.Context, r *http.Request, opts *RequestOptions) (map[string]interface{}, error)
RootObjectFn allows a user to generate a RootObject per request
type FinishFn ¶ added in v0.2.9
type FinishFn func(ctx context.Context, w http.ResponseWriter, r *http.Request, buf []byte, opts *RequestOptions)
type Handler ¶
func (*Handler) ContextHandler ¶
ContextHandler provides an entrypoint into executing graphQL queries with a user-provided context.
type RequestOptions ¶
type RequestOptions struct { Query string `json:"query" url:"query" schema:"query"` Variables map[string]interface{} `json:"variables" url:"variables" schema:"variables"` OperationName string `json:"operationName" url:"operationName" schema:"operationName"` File map[string][]*multipart.FileHeader `json:"-"` Time time.Time `json:"-"` //开始时间 }
func NewRequestOptions ¶
func NewRequestOptions(r *http.Request, h *Handler) *RequestOptions
RequestOptions Parses a http.Request into GraphQL request options struct
Click to show internal directories.
Click to hide internal directories.