celfuncs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package celfuncs provides functions for use in a Common Expression Language (CEL) environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllFileOptions

func AllFileOptions(docs *Docs) []cel.EnvOption

AllFileOptions returns CEL functions for reading an fs.FS filesystem. This can only be used alongside the FilesystemVariables options.

func AllPackageManagerFunctions

func AllPackageManagerFunctions(docs *Docs) []cel.EnvOption

AllPackageManagerFunctions returns CEL functions for reading package manager dependencies in an fs.FS filesystem. This can only be used alongside the FilesystemVariables options.

func CustomEnvOptions

func CustomEnvOptions(docs *Docs) []cel.EnvOption

CustomEnvOptions returns the customized CEL options.

func DefaultEnvOptions

func DefaultEnvOptions() []cel.EnvOption

DefaultEnvOptions returns default options for creating a Common Expression Language (CEL) environment.

func DepExists

func DepExists(docs *Docs) cel.EnvOption

func DepVersion

func DepVersion(docs *Docs) cel.EnvOption

func FileContains

func FileContains(docs *Docs) cel.EnvOption

func FileExists

func FileExists(docs *Docs) cel.EnvOption

func FileGlob

func FileGlob(docs *Docs) cel.EnvOption

func FileIsDir

func FileIsDir(docs *Docs) cel.EnvOption

func FileRead

func FileRead(docs *Docs) cel.EnvOption

func FilesystemInput

func FilesystemInput(fsys fs.FS, path string) map[string]any

FilesystemInput returns a CEL program input for a filesystem named "fs", and a file path variable named "path". This can only be used alongside the FilesystemVariables options.

func FilesystemVariables

func FilesystemVariables() []cel.EnvOption

FilesystemVariables returns CEL options to create variables corresponding to FilesystemInput.

func JQ

func JQ(docs *Docs) cel.EnvOption

func YQ

func YQ(docs *Docs) cel.EnvOption

Types

type ArgDoc

type ArgDoc struct {
	Name    string
	Comment string
}

type Docs

type Docs struct {
	// contains filtered or unexported fields
}

func (*Docs) AddFunction

func (d *Docs) AddFunction(name string, fd FuncDoc)

func (*Docs) GetFunction

func (d *Docs) GetFunction(name string) (*FuncDoc, bool)

type FuncDoc

type FuncDoc struct {
	Comment     string
	Description string
	Args        []ArgDoc
}

Jump to

Keyboard shortcuts

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