Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFlagType = fmt.Errorf("not a valid FlagType, try [%s]", strings.Join(_FlagTypeNames, ", "))
Functions ¶
func FlagTypeNames ¶ added in v0.8.0
func FlagTypeNames() []string
FlagTypeNames returns a list of possible string values of FlagType.
func Lists ¶ added in v0.8.0
Lists provides a CEL function library extension of list utility functions.
isSorted
Returns true if the provided list of comparable elements is sorted, else returns false.
<list<T>>.isSorted() <bool>, T must be a comparable type
Examples:
[1, 2, 3].isSorted() // return true ['a', 'b', 'b', 'c'].isSorted() // return true [2.0, 1.0].isSorted() // return false [1].isSorted() // return true [].isSorted() // return true
sum
Returns the sum of the elements of the provided list. Supports CEL number (int, uint, double) and duration types.
<list<T>>.sum() <T>, T must be a numeric type or a duration
Examples:
[1, 3].sum() // returns 4 [1.0, 3.0].sum() // returns 4.0 ['1m', '1s'].sum() // returns '1m1s' emptyIntList.sum() // returns 0 emptyDoubleList.sum() // returns 0.0 [].sum() // returns 0
min / max
Returns the minimum/maximum valued element of the provided list. Supports all comparable types. If the list is empty, an error is returned.
<list<T>>.min() <T>, T must be a comparable type <list<T>>.max() <T>, T must be a comparable type
Examples:
[1, 3].min() // returns 1 [1, 3].max() // returns 3 [].min() // error [1].min() // returns 1 ([0] + emptyList).min() // returns 0
indexOf / lastIndexOf
Returns either the first or last positional index of the provided element in the list. If the element is not found, -1 is returned. Supports all equatable types.
<list<T>>.indexOf(<T>) <int>, T must be an equatable type <list<T>>.lastIndexOf(<T>) <int>, T must be an equatable type
Examples:
[1, 2, 2, 3].indexOf(2) // returns 1 ['a', 'b', 'b', 'c'].lastIndexOf('b') // returns 2 [1.0].indexOf(1.1) // returns -1 [].indexOf('string') // returns -1
Types ¶
type Config ¶ added in v0.8.0
type Config struct { Workflow string Keywords map[string][]string Extensions map[string][]string Flags map[string]any DeleteXxx bool }
func NewDefaultConfig ¶ added in v0.8.0
func NewDefaultConfig() Config
type FlagType ¶ added in v0.8.0
type FlagType string
FlagType represents the type of a flag ENUM(bool, string, int, string_list, content_type_list)
func FlagTypeValues ¶ added in v0.8.0
func FlagTypeValues() []FlagType
FlagTypeValues returns a list of the values for FlagType
func ParseFlagType ¶ added in v0.8.0
ParseFlagType attempts to convert a string to a FlagType.
func (FlagType) IsValid ¶ added in v0.8.0
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (FlagType) MarshalText ¶ added in v0.8.0
MarshalText implements the text marshaller method.
func (*FlagType) UnmarshalText ¶ added in v0.8.0
UnmarshalText implements the text unmarshaller method.
type HasJsonSchema ¶ added in v0.8.0
type HasJsonSchema interface {
JsonSchema() JsonSchema
}
type JsonSchema ¶ added in v0.8.0
func DefaultJsonSchema ¶ added in v0.8.0
func DefaultJsonSchema() JsonSchema
func (JsonSchema) MarshalJSON ¶ added in v0.8.0
func (s JsonSchema) MarshalJSON() ([]byte, error)
type LocalSearch ¶ added in v0.8.0
type NullFlagType ¶ added in v0.8.0
func NewNullFlagType ¶ added in v0.8.0
func NewNullFlagType(val interface{}) (x NullFlagType)
func (NullFlagType) MarshalJSON ¶ added in v0.8.0
func (n NullFlagType) MarshalJSON() ([]byte, error)
MarshalJSON correctly serializes a NullFlagType to JSON.
func (*NullFlagType) Scan ¶ added in v0.8.0
func (x *NullFlagType) Scan(value interface{}) (err error)
Scan implements the Scanner interface.
func (*NullFlagType) UnmarshalJSON ¶ added in v0.8.0
func (n *NullFlagType) UnmarshalJSON(b []byte) error
UnmarshalJSON correctly deserializes a NullFlagType from JSON.
type PayloadTransformerFunc ¶ added in v0.8.0
type Result ¶
type Source ¶ added in v0.8.0
type Source struct { Schema string `json:"$schema,omitempty" yaml:"$schema,omitempty"` Workflows workflowSources `json:"workflows"` FlagDefinitions flagDefinitions `json:"flag_definitions"` Flags flags `json:"flags"` Keywords keywordGroups `json:"keywords"` Extensions extensionGroups `json:"extensions"` }
type TypedPayload ¶ added in v0.8.0
type TypedPayload[T any] interface { HasJsonSchema Unmarshal(ctx compilerContext) (T, error) }
Source Files ¶
- action.go
- action_add_tag.go
- action_attach_local_content_by_id.go
- action_attach_local_content_by_search.go
- action_attach_tmdb_content_by_id.go
- action_attach_tmdb_content_by_search.go
- action_delete.go
- action_find_match.go
- action_if_else.go
- action_parse_date.go
- action_parse_video_content.go
- action_run_workflow.go
- action_set_content_type.go
- action_unmatched.go
- cel_env.go
- cel_lists.go
- classifier.go
- condition.go
- condition_and.go
- condition_expression.go
- condition_not.go
- condition_or.go
- config.go
- decoder.go
- dependencies.go
- factory.go
- features.go
- flag.go
- flag_type.go
- flag_type_enum.go
- json_schema.go
- payload.go
- runner.go
- search.go
- source.go
- source_core.go
- source_provider.go
- tmdb.go
- util.go