Documentation ¶
Index ¶
- Constants
- Variables
- func Val(typ int, v []byte) (interface{}, bool)
- type CacheAdaptor
- type Client
- type Context
- type Cookie
- type CustomFunc
- type DataLoaderAdaptor
- type Device
- type GQLEvent
- type GQLSubscriptionAdaptor
- type HandlerFunc
- type HandlerFuncs
- type Hardware
- type Header
- type Identity
- type KV
- type MessageAdaptor
- type Model
- type OS
- type Option
- type Options
- type Param
- type ParamConfig
- type ParamType
- type ProtoMessage
- type Route
- type RouteConfig
- type Service
- type Useragent
- type Value
Constants ¶
View Source
const ( Any int = iota Text Int I32 I64 U32 U64 F32 F64 Bool Lat Lon Json Email URL UUID File DateTimeRFC822 DateTimeRFC3339 DateTimeUnix )
Variables ¶
View Source
var RequestContext = key("request-context")
RequestContext key
Functions ¶
Types ¶
type CacheAdaptor ¶
type CacheAdaptor interface { Set(key []byte, data []byte, ttl time.Duration) error Get(key []byte) ([]byte, error) }
CacheAdaptor interface
type Context ¶
type Context interface { Deadline() (time.Time, bool) Done() <-chan struct{} Err() error Value(interface{}) interface{} Identity() Identity MachineID() string ProcessID() string Context() context.Context Req() *http.Request Res() http.ResponseWriter Client() Client Cache() CacheAdaptor Message() MessageAdaptor GQLSubscription() GQLSubscriptionAdaptor DataLoader(interface{}) DataLoaderAdaptor KV() KV Cookie() Cookie Header() Header MustParam(s string) Value MustQuery(s string) Value MustBody(s string) Value Param(s string) (Value, error) Query(s string) (Value, error) Body(s string) (Value, error) File(s string) []byte StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span Tracer() opentracing.Tracer Recover() error Abort() IsAborted() bool Proto(ProtoMessage) Context Write(b []byte) Context Error(error) Context Json(o interface{}) Context Status(code int) Context Child() Context }
Context interface
type Cookie ¶
type Cookie interface { Set(key string, val string, opts ...cookie.Option) Get(key string) (Value, error) MustGet(key string) Value }
Cookie interface
type DataLoaderAdaptor ¶
type DataLoaderAdaptor interface { Load(context.Context, interface{}) (interface{}, error) LoadMany(context.Context, []interface{}) ([]interface{}, []error) Clear(interface{}) ClearAll() Prime(interface{}, interface{}) }
DataLoaderAdaptor interface
type GQLEvent ¶
type GQLEvent interface { Field() string Payload() []byte Filters() map[string]interface{} EqIDs() []int64 NeIDs() []int64 EqKeys() []string NeKeys() []string Strict() bool }
GQLEvent interface
type GQLSubscriptionAdaptor ¶
GQLSubscriptionAdaptor interface
type Header ¶
type Header interface { Set(key string, val string) Get(key string) (Value, error) MustGet(key string) Value }
Header interface
type Identity ¶
type Identity interface { HasID() bool GetID() int SetID(int) HasKey() bool GetKey() string SetKey(string) }
Identity interface
type MessageAdaptor ¶
type MessageAdaptor interface { Emit([]byte, []byte) error Listen([]byte, message.Handler) message.Close }
MessageAdaptor broker interface
type Options ¶
type Options struct { // engine server unique id ID string }
Options is the engine server options
type Param ¶
type Param interface { Custom(CustomFunc) Param Format(int) Param Summary(string) Param Doc(string) Param Default([]byte) Param Require(bool) Param DependsOn(...Param) Param Config() ParamConfig }
Param interface
type ParamConfig ¶
type ParamConfig interface { Name() string Type() ParamType Custom() CustomFunc Format() int Summary() string Doc() string Default() []byte Require() bool DependsOn() []Param OneOf() []Param }
ParamConfig interface
type ParamType ¶
type ParamType int
ParamType type
type ProtoMessage ¶
type ProtoMessage interface { Reset() String() string ProtoMessage() }
ProtoMessage message interface
type Route ¶
type Route interface { Get(string) Route Head(string) Route Options(string) Route Post(string) Route Put(string) Route Patch(string) Route Delete(string) Route Namespace(string) Route Alias(...string) Route Name(string) Route Summary(string) Route Doc(string) Route Params(...Param) Route ClearParams() Route MaxMemory(int64) Route Handle(HandlerFunc) Route Catch(HandlerFunc) Route Middleware(...HandlerFunc) Route ClearMiddleware() Route Websocket(bool) Route HTTP(bool) Route Models(...Model) Route Config() RouteConfig }
Route interface
type RouteConfig ¶
type RouteConfig interface { Pattern() string Aliases() []string Method() string Name() string Summary() string Doc() string Namespace() bool Websocket() bool HTTP() bool Params() []Param ValueIndex(Param) int MaxMemory() int64 Routes() []Route Handler() HandlerFunc Catch() HandlerFunc Middlewares() HandlerFuncs Model(int) interface{} }
RouteConfig interface
type Service ¶
type Service interface { Start() error Stop() error Get(string) Route Head(string) Route Options(string) Route Post(string) Route Put(string) Route Patch(string) Route Delete(string) Route Namespace(string) Route NotFound(HandlerFunc) Service MethodNotAllowed(HandlerFunc) Service Params(...Param) Service Middleware(...HandlerFunc) Service RouteNotFound() HandlerFunc RouteNotAllowed() HandlerFunc Routes() []Route String() string }
Service interface
Source Files ¶
Click to show internal directories.
Click to hide internal directories.