Documentation ¶
Index ¶
- Constants
- Variables
- func Body(name string) router.Param
- func Context(c context.Context) router.Context
- func Cookie(name string) router.Param
- func GraphQL(schema graphql.Schema) router.HandlerFunc
- func GraphiQL() router.HandlerFunc
- func Header(name string) router.Param
- func Model(code int, response interface{}) router.Model
- func OneOf(ps ...router.Param) router.Param
- func Param(name string) router.Param
- func Query(name string) router.Param
- type Hyper
- type Option
- func Addr(s string) Option
- func AfterStop(f func() error) Option
- func AllowCredentials(b bool) Option
- func AllowOriginFunc(f func(string) bool) Option
- func AllowedHeaders(a []string) Option
- func AllowedMethods(a []string) Option
- func AllowedOrigins(a []string) Option
- func BeforeStart(f func() error) Option
- func Cache(c cache.Service) Option
- func DataLoader(d dataloader.Service) Option
- func ExposedHeaders(a []string) Option
- func HTTP() Option
- func HTTP2() Option
- func ID(s string) Option
- func MaxAge(i int) Option
- func Message(m message.Service) Option
- func OptionsPassthrough(b bool) Option
- func Router(r router.Service) Option
- func Sync(s sync.Service) Option
- type Options
- type Payload
Constants ¶
View Source
const ( Any = router.Any Text = router.Text Int = router.Int I32 = router.I32 I64 = router.I64 U32 = router.U32 U64 = router.U64 F32 = router.F32 F64 = router.F64 Bool = router.Bool Lat = router.Lat Lon = router.Lon Json = router.Json Email = router.Email URL = router.URL UUID = router.UUID File = router.File DateTimeRFC822 = router.DateTimeRFC822 DateTimeRFC3339 = router.DateTimeRFC3339 DateTimeUnix = router.DateTimeUnix )
View Source
const ( StatusContinue = 100 StatusSwitchingProtocols = 101 StatusOK = 200 StatusCreated = 201 StatusAccepted = 202 StatusNonAuthoritativeInfo = 203 StatusNoContent = 204 StatusResetContent = 205 StatusPartialContent = 206 StatusMultipleChoices = 300 StatusMovedPermanently = 301 StatusFound = 302 StatusSeeOther = 303 StatusNotModified = 304 StatusUseProxy = 305 StatusTemporaryRedirect = 307 StatusBadRequest = 400 StatusPaymentRequired = 402 StatusForbidden = 403 StatusNotFound = 404 StatusMethodNotAllowed = 405 StatusNotAcceptable = 406 StatusProxyAuthRequired = 407 StatusRequestTimeout = 408 StatusConflict = 409 StatusGone = 410 StatusLengthRequired = 411 StatusPreconditionFailed = 412 StatusRequestEntityTooLarge = 413 StatusRequestURITooLong = 414 StatusUnsupportedMediaType = 415 StatusRequestedRangeNotSatisfiable = 416 StatusExpectationFailed = 417 StatusTeapot = 418 StatusInternalServerError = 500 StatusNotImplemented = 501 StatusBadGateway = 502 StatusGatewayTimeout = 504 StatusHTTPVersionNotSupported = 505 )
HTTP Status
Variables ¶
View Source
var GQLBodies = []router.Param{ Body("query"). Format(Text). Require(false), Body("variables"). Format(Text). Require(false), }
GQLBodies parameters
View Source
var GQLQueries = []router.Param{ Query("query"). Format(Text). Require(false), Query("variables"). Format(Text). Require(false), }
GQLQueries parameters
Functions ¶
Types ¶
type Option ¶
type Option func(*Options)
Option func
func AllowCredentials ¶
func AllowOriginFunc ¶
func AllowedHeaders ¶
func AllowedMethods ¶
func AllowedOrigins ¶
func BeforeStart ¶
BeforeStart to add before start action to hyper server
func ExposedHeaders ¶
func OptionsPassthrough ¶
type Options ¶
type Options struct { // hyper server unique id ID string // server bind to address [host:port] Addr string // HTTP protocol 1.1 / 2.0 Protocol engine.Protocol // sync engine Sync sync.Service // graphql subscription engine GQLSubscription gws.Service // Cache engine Cache cache.Service // Router Router router.Service // Message broker Message message.Service // DataLoader DataLoader dataloader.Service // before and after funcs BeforeStart []func() error AfterStop []func() error // AllowedOrigins is a list of origins a cross-domain request can be executed from. // If the special "*" value is present in the list, all origins will be allowed. // An origin may contain a wildcard (*) to replace 0 or more characters // (i.e.: http://*.domain.com). Usage of wildcards implies a small performance penality. // Only one wildcard can be used per origin. // Default value is ["*"] AllowedOrigins []string // AllowOriginFunc is a custom function to validate the origin. It take the origin // as argument and returns true if allowed or false otherwise. If this option is // set, the content of AllowedOrigins is ignored. AllowOriginFunc func(origin string) bool // AllowedMethods is a list of methods the client is allowed to use with // cross-domain requests. Default value is simple methods (GET and POST) AllowedMethods []string // AllowedHeaders is list of non simple headers the client is allowed to use with // cross-domain requests. // If the special "*" value is present in the list, all headers will be allowed. // Default value is [] but "Origin" is always appended to the list. AllowedHeaders []string // ExposedHeaders indicates which headers are safe to expose to the API of a CORS // API specification ExposedHeaders []string // AllowCredentials indicates whether the request can include user credentials like // cookies, HTTP authentication or client side SSL certificates. AllowCredentials bool // MaxAge indicates how long (in seconds) the results of a preflight request // can be cached MaxAge int // OptionsPassthrough instructs preflight to let other potential next handlers to // process the OPTIONS method. Turn this on if your application handles OPTIONS. OptionsPassthrough bool }
Options is the hyper server options
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package dataloader source: https://github.com/nicksrandall/dataloader dataloader is an implimentation of facebook's dataloader in go.
|
Package dataloader source: https://github.com/nicksrandall/dataloader dataloader is an implimentation of facebook's dataloader in go. |
examples
|
|
Package gws is a generated protocol buffer package.
|
Package gws is a generated protocol buffer package. |
Package sync is a generated protocol buffer package.
|
Package sync is a generated protocol buffer package. |
Click to show internal directories.
Click to hide internal directories.