cel

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Data map[string]interface{}
	// contains filtered or unexported fields
}

Context makes it easy to execute CEL expressions on a hook body.

func New

func New(hook scm.Webhook) (*Context, error)

New creates and returns a Context for evaluating expressions.

func (*Context) Evaluate

func (c *Context) Evaluate(expr string) (ref.Val, error)

Evaluate evaluates the provided expression and returns the result.

func (*Context) EvaluateToString

func (c *Context) EvaluateToString(expr string) (string, error)

EvaluateToString evaluates the provided expression, and marshals it to a string before returning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL