Documentation
¶
Index ¶
- type Client
- type Context
- func (v *Context) Abort()
- func (v *Context) Body(s string) (router.Value, error)
- func (v *Context) Cache() router.CacheAdaptor
- func (v *Context) Child() router.Context
- func (v *Context) Client() router.Client
- func (v *Context) Context() context.Context
- func (v *Context) Cookie() router.Cookie
- func (v *Context) DataLoader(o interface{}) router.DataLoaderAdaptor
- func (v *Context) Deadline() (time.Time, bool)
- func (v *Context) Done() <-chan struct{}
- func (v *Context) Err() error
- func (v *Context) Error(e error) router.Context
- func (v *Context) File(s string) []byte
- func (v *Context) GQLSubscription() router.GQLSubscriptionAdaptor
- func (v *Context) Header() router.Header
- func (v *Context) Identity() router.Identity
- func (v *Context) IsAborted() bool
- func (v *Context) Json(o interface{}) router.Context
- func (v *Context) KV() router.KV
- func (v *Context) MachineID() string
- func (v *Context) MatchParameter(s string, typ router.ParamType) router.Value
- func (v *Context) Message() router.MessageAdaptor
- func (v *Context) MustBody(s string) router.Value
- func (v *Context) MustParam(s string) router.Value
- func (v *Context) MustQuery(s string) router.Value
- func (v *Context) Param(s string) (router.Value, error)
- func (v *Context) ProcessID() string
- func (v *Context) Proto(i router.ProtoMessage) router.Context
- func (v *Context) Query(s string) (router.Value, error)
- func (v *Context) Recover() error
- func (v *Context) Req() *http.Request
- func (v *Context) Res() http.ResponseWriter
- func (v *Context) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span
- func (v *Context) Status(code int) router.Context
- func (v *Context) Tracer() opentracing.Tracer
- func (v *Context) Value(key interface{}) interface{}
- func (v *Context) Write(b []byte) router.Context
- type Cookie
- type Device
- type Hardware
- type Header
- type OS
- type Option
- func Addr(s string) 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 Cache(c cache.Service) Option
- func DataLoader(d dataloader.Service) Option
- func ExposedHeaders(a []string) Option
- func GQLSubscription(s gws.Service) Option
- func ID(s string) Option
- func MaxAge(i int) Option
- func Message(m message.Service) Option
- func OptionsPassthrough(b bool) Option
- func Proto(p Protocol) Option
- func Router(r router.Service) Option
- func Websocket(w websocket.Service) Option
- type Options
- type Protocol
- type Service
- type Useragent
- type Value
- func (v *Value) Has() bool
- func (v *Value) Key() string
- func (v *Value) MustBool() bool
- func (v *Value) MustF32() float32
- func (v *Value) MustF64() float64
- func (v *Value) MustI32() int32
- func (v *Value) MustI64() int64
- func (v *Value) MustInt() int
- func (v *Value) MustTime() time.Time
- func (v *Value) MustU32() uint32
- func (v *Value) MustU64() uint64
- func (v *Value) String() string
- func (v *Value) ThrowIllegal(cause fault.Cause)
- func (v *Value) Type() router.ParamType
- func (v *Value) Val() []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Cache ¶
func (v *Context) Cache() router.CacheAdaptor
func (*Context) DataLoader ¶
func (v *Context) DataLoader(o interface{}) router.DataLoaderAdaptor
func (*Context) GQLSubscription ¶
func (v *Context) GQLSubscription() router.GQLSubscriptionAdaptor
func (*Context) MatchParameter ¶
func (*Context) Message ¶
func (v *Context) Message() router.MessageAdaptor
func (*Context) Res ¶
func (v *Context) Res() http.ResponseWriter
func (*Context) StartSpan ¶
func (v *Context) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span
func (*Context) Tracer ¶
func (v *Context) Tracer() opentracing.Tracer
type Cookie ¶
type Cookie struct {
// contains filtered or unexported fields
}
Cookie struct
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device struct
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header struct
type Option ¶
type Option func(*Options)
Option func
func AllowCredentials ¶
func AllowOriginFunc ¶
func AllowedHeaders ¶
func AllowedMethods ¶
func AllowedOrigins ¶
func ExposedHeaders ¶
func GQLSubscription ¶
GQLSubscription to bind graphql subscription interface to engine server
func OptionsPassthrough ¶
type Options ¶
type Options struct {
// engine server unique id
ID string
// server bind to address [host:port]
Addr string
// HTTP protocol 1.1 / 2.0
Protocol Protocol
// Cache
Cache cache.Service
// Message broker
Message message.Service
// GraphQL subscription server
GQLSubscription gws.Service
// DataLoader
DataLoader dataloader.Service
// Router
Router router.Service
// Websocket service
Websocket websocket.Service
// 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 engine server options
type Protocol ¶
type Protocol float32
Protocol type
const ( HTTP Protocol = 1.1 HTTP2 = 2 )
Protocols
type Useragent ¶
type Useragent struct {
// contains filtered or unexported fields
}
Useragent struct
Click to show internal directories.
Click to hide internal directories.