Documentation
¶
Index ¶
- Constants
- type Auth
- type AuthCtx
- type Engine
- func (e *Engine) CreateTable(name string, schema interface{})
- func (e *Engine) ExecuteMutation(mutation string, params map[string]interface{}, clientID string, ...) (interface{}, error)
- func (e *Engine) ExecuteMutationInternal(mutation string, params map[string]interface{}) (interface{}, error)
- func (e *Engine) ExecuteQuery(query string, params map[string]interface{}, ...) ([]byte, error)
- func (e *Engine) GetDependentQueries(tableName string) []string
- func (e *Engine) Handle(w http.ResponseWriter, r *http.Request)
- func (e *Engine) InvalidateTag(tag string)
- func (e *Engine) InvalidateTags(tags []string, execID string, actionName string)
- func (e *Engine) OnConnect(clientID string) error
- func (e *Engine) OnDisconnect(clientID string) error
- func (e *Engine) OnReceiveMessage(clientID string, msg map[string]interface{}) error
- func (e *Engine) RegisterMutation(name string, mutation func(ctx *MutationCtx) interface{}, ...)
- func (e *Engine) RegisterQuery(name string, query func(ctx *QueryCtx) interface{}, dependencies []string, ...)
- func (e *Engine) SetAllowedOrigins(allowedOrigins []string)
- func (e *Engine) SetAuth(auth Auth)
- func (e *Engine) SetCheckOrigin(checkOrigin func(r *http.Request) bool)
- type Mutation
- type MutationCtx
- type MutationOptions
- type Query
- type QueryCtx
- type QueryOptions
Constants ¶
View Source
const ( ContextKeyExecutionID traceContextKey = "exec_id" ContextKeyActionName traceContextKey = "action_name" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
func (*Engine) CreateTable ¶
func (*Engine) ExecuteMutation ¶
func (*Engine) ExecuteMutationInternal ¶ added in v0.3.0
func (*Engine) ExecuteQuery ¶
func (e *Engine) ExecuteQuery(query string, params map[string]interface{}, subscription *reactivity.Subscription, forceSend bool) ([]byte, error)
func (*Engine) GetDependentQueries ¶
func (*Engine) InvalidateTag ¶
func (*Engine) InvalidateTags ¶ added in v0.2.0
InvalidateTags re-runs each distinct subscription that listens to any of the given tags. Subscriptions are snapshotted before any query executes so a re-run that picks up additional tags (e.g. auto-tracked primary keys) cannot cause the same mutation to fire the query a second time. Matching subscriptions (same query, params, and auth fingerprint) share one execution and are fanned out with each client's own query_key.
func (*Engine) OnDisconnect ¶
func (*Engine) OnReceiveMessage ¶
func (*Engine) RegisterMutation ¶
func (e *Engine) RegisterMutation(name string, mutation func(ctx *MutationCtx) interface{}, opts ...MutationOptions)
func (*Engine) RegisterQuery ¶
func (e *Engine) RegisterQuery(name string, query func(ctx *QueryCtx) interface{}, dependencies []string, opts ...QueryOptions)
func (*Engine) SetAllowedOrigins ¶
Simple helper to set the allowed origins for the websocket connection
type Mutation ¶ added in v0.3.0
type Mutation struct {
Func func(ctx *MutationCtx) interface{}
Internal bool
}
type MutationCtx ¶
type MutationOptions ¶ added in v0.3.0
type MutationOptions struct {
Internal bool
}
type QueryCtx ¶
type QueryCtx struct {
DB *gorm.DB
Auth *AuthCtx
Params map[string]interface{}
Dependencies []string
}
func (*QueryCtx) TrackCollection ¶
func (*QueryCtx) TrackTable ¶
type QueryOptions ¶ added in v0.3.0
type QueryOptions struct {
Internal bool
}
Click to show internal directories.
Click to hide internal directories.