Documentation ¶
Index ¶
- Variables
- func NextId() uint64
- type AggregatorCtx
- type NullExplainer
- func (self *NullExplainer) Log(message string)
- func (self *NullExplainer) ParseArgs(args *ordereddict.Dict, result interface{}, err error)
- func (self *NullExplainer) PluginOutput(ast_node interface{}, row types.Row)
- func (self *NullExplainer) RejectRow(where_ast_node interface{})
- func (self *NullExplainer) SelectOutput(row types.Row)
- func (self *NullExplainer) StartQuery(select_ast_node interface{})
- type Scope
- func (self *Scope) Add(a types.Any, b types.Any) types.Any
- func (self *Scope) AddDestructor(fn func()) error
- func (self *Scope) AddProtocolImpl(implementations ...types.Any) types.Scope
- func (self *Scope) AppendFunctions(functions ...types.FunctionInterface) types.Scope
- func (self *Scope) AppendPlugins(plugins ...types.PluginGeneratorInterface) types.Scope
- func (self *Scope) AppendVars(row types.Row) types.Scope
- func (self *Scope) Associative(a types.Any, b types.Any) (types.Any, bool)
- func (self *Scope) Bool(a types.Any) bool
- func (self *Scope) ChargeOp()
- func (self *Scope) CheckForOverflow() bool
- func (self *Scope) ClearContext()
- func (self *Scope) Close()
- func (self *Scope) Copy() types.Scope
- func (self *Scope) Debug(format string, a ...interface{})
- func (self *Scope) DecDepth()
- func (self *Scope) Describe(type_map *types.TypeMap) *types.ScopeInformation
- func (self *Scope) Div(a types.Any, b types.Any) types.Any
- func (self *Scope) EnableExplain()
- func (self *Scope) Eq(a types.Any, b types.Any) bool
- func (self *Scope) Error(format string, a ...interface{})
- func (self *Scope) Explainer() types.Explainer
- func (self *Scope) GetAggregatorCtx() types.AggregatorCtx
- func (self *Scope) GetContext(name string) (types.Any, bool)
- func (self *Scope) GetDepth() int
- func (self *Scope) GetFunction(name string) (types.FunctionInterface, bool)
- func (self *Scope) GetLogger() *log.Logger
- func (self *Scope) GetMembers(a types.Any) []string
- func (self *Scope) GetPlugin(name string) (types.PluginGeneratorInterface, bool)
- func (self *Scope) GetSimilarPlugins(name string) []string
- func (self *Scope) GetStats() *types.Stats
- func (self *Scope) Group(ctx context.Context, scope types.Scope, actor types.GroupbyActor) <-chan types.Row
- func (self *Scope) Gt(a types.Any, b types.Any) bool
- func (self *Scope) IncDepth()
- func (self *Scope) Info(type_map *types.TypeMap, name string) (*types.PluginInfo, bool)
- func (self *Scope) IsClosed() bool
- func (self *Scope) Iterate(ctx context.Context, a types.Any) <-chan types.Row
- func (self *Scope) Log(format string, a ...interface{})
- func (self *Scope) Lt(a types.Any, b types.Any) bool
- func (self *Scope) Marshal(scope types.Scope) (*types.MarshalItem, error)
- func (self *Scope) Match(a types.Any, b types.Any) bool
- func (self *Scope) Materialize(ctx context.Context, name string, query types.StoredQuery) types.StoredQuery
- func (self *Scope) Membership(a types.Any, b types.Any) bool
- func (self *Scope) Mul(a types.Any, b types.Any) types.Any
- func (self *Scope) NewScope() types.Scope
- func (self *Scope) PrintVars() string
- func (self *Scope) Resolve(field string) (interface{}, bool)
- func (self *Scope) SetAggregatorCtx(ctx types.AggregatorCtx)
- func (self *Scope) SetContext(name string, value types.Any)
- func (self *Scope) SetExplainer(explainer types.Explainer)
- func (self *Scope) SetGrouper(grouper types.Grouper)
- func (self *Scope) SetLogger(logger *log.Logger)
- func (self *Scope) SetMaterializer(materializer types.ScopeMaterializer)
- func (self *Scope) SetSorter(sorter types.Sorter)
- func (self *Scope) SetThrottler(t types.Throttler)
- func (self *Scope) SetTracer(logger *log.Logger)
- func (self *Scope) Sort(ctx context.Context, scope types.Scope, input <-chan types.Row, key string, ...) <-chan types.Row
- func (self *Scope) StackDepth() int
- func (self *Scope) String() string
- func (self *Scope) Sub(a types.Any, b types.Any) types.Any
- func (self *Scope) Trace(format string, a ...interface{})
- func (self *Scope) Warn(format string, a ...interface{})
- type ScopeItems
- type ScopeUnmarshaller
Constants ¶
This section is empty.
Variables ¶
var (
NULL_EXPLAINER = &NullExplainer{}
)
Functions ¶
Types ¶
type AggregatorCtx ¶
type AggregatorCtx struct {
// contains filtered or unexported fields
}
func NewAggregatorCtx ¶
func NewAggregatorCtx() *AggregatorCtx
type NullExplainer ¶
type NullExplainer struct{}
func (*NullExplainer) Log ¶
func (self *NullExplainer) Log(message string)
func (*NullExplainer) ParseArgs ¶
func (self *NullExplainer) ParseArgs(args *ordereddict.Dict, result interface{}, err error)
func (*NullExplainer) PluginOutput ¶
func (self *NullExplainer) PluginOutput( ast_node interface{}, row types.Row)
func (*NullExplainer) RejectRow ¶
func (self *NullExplainer) RejectRow(where_ast_node interface{})
func (*NullExplainer) SelectOutput ¶
func (self *NullExplainer) SelectOutput(row types.Row)
func (*NullExplainer) StartQuery ¶
func (self *NullExplainer) StartQuery(select_ast_node interface{})
type Scope ¶
The scope is a common environment passed to all plugins, functions and operators.
The scope contains all the client specific code which velocifilter will use to actually execute the query. For example, clients may add new plugins (See PluginGeneratorInterface{}), functions (see FunctionInterface{}) or various protocol implementations to the scope prior to evaluating any queries. This is the main mechanism where clients may extend and specialize the VQL language.
The scope also contains convenience functions allowing clients to execute available protocols.
The scope may be populated with free variables that can be referenced by the query.
func NewScope ¶
func NewScope() *Scope
A factory for the default scope. This will add all built in protocols for commonly used code. Clients are expected to add their own specialized protocols, functions and plugins to specialize their scope objects.
func (*Scope) AddDestructor ¶
Adding a destructor to the current scope will call it when any parent scopes are closed.
func (*Scope) AddProtocolImpl ¶
Add various protocol implementations into this scope. Implementations must be one of the supported protocols or this function will panic.
func (*Scope) AppendFunctions ¶
func (self *Scope) AppendFunctions(functions ...types.FunctionInterface) types.Scope
Add client function implementations to the scope. Queries using this scope can call these functions from within VQL queries.
func (*Scope) AppendPlugins ¶
func (self *Scope) AppendPlugins(plugins ...types.PluginGeneratorInterface) types.Scope
Add plugins (data sources) to the scope. VQL queries may select from these newly added plugins.
func (*Scope) AppendVars ¶
Append the variables in types.Row to the scope.
func (*Scope) Associative ¶
Get the field member b from a (i.e. a.b).
func (*Scope) CheckForOverflow ¶
func (*Scope) ClearContext ¶
func (self *Scope) ClearContext()
func (*Scope) Close ¶
func (self *Scope) Close()
Closing a scope will also close all its children. Note that destructors may use the scope so we can not lock it for the duration.
func (*Scope) Describe ¶
func (self *Scope) Describe(type_map *types.TypeMap) *types.ScopeInformation
func (*Scope) EnableExplain ¶
func (self *Scope) EnableExplain()
func (*Scope) GetAggregatorCtx ¶
func (self *Scope) GetAggregatorCtx() types.AggregatorCtx
Get the aggregator context from the scope or one of its parents.
func (*Scope) GetFunction ¶
func (self *Scope) GetFunction(name string) (types.FunctionInterface, bool)
func (*Scope) GetPlugin ¶
func (self *Scope) GetPlugin(name string) (types.PluginGeneratorInterface, bool)
func (*Scope) GetSimilarPlugins ¶
Get a list of similar sounding plugins.
func (*Scope) Materialize ¶
func (self *Scope) Materialize(ctx context.Context, name string, query types.StoredQuery) types.StoredQuery
func (*Scope) Membership ¶
Is a a member in b?
func (*Scope) SetAggregatorCtx ¶
func (self *Scope) SetAggregatorCtx(ctx types.AggregatorCtx)
func (*Scope) SetExplainer ¶
func (*Scope) SetGrouper ¶
func (*Scope) SetMaterializer ¶
func (self *Scope) SetMaterializer(materializer types.ScopeMaterializer)
func (*Scope) SetThrottler ¶
func (*Scope) StackDepth ¶
type ScopeItems ¶
type ScopeItems struct {
Vars map[string]*types.MarshalItem `json:"vars,omitempty"`
}
Marshal a scope so it can be restored.
type ScopeUnmarshaller ¶
type ScopeUnmarshaller struct {
IgnoreVars []string
}
func (ScopeUnmarshaller) Unmarshal ¶
func (self ScopeUnmarshaller) Unmarshal( unmarshaller types.Unmarshaller, scope types.Scope, item *types.MarshalItem) (interface{}, error)