Versions in this module Expand all Collapse all v0 v0.0.2 Sep 20, 2024 v0.0.1 Sep 20, 2024 Changes in this version + const Bytes + const Day + const Gibibytes + const Gigabytes + const Hour + const Kibibytes + const Kilobytes + const Mebibytes + const Megabytes + const Microsecond + const Millisecond + const Minute + const Nanosecond + const Pebibytes + const Petabytes + const Second + const StructTag + const Tebibytes + const Terabytes + var MaybePreconfiguredOptions = func(opts *EvaluatorOptions) + var NoopLogger = NewLogger(io.Discard) + var PreconfiguredOptions = func(opts *EvaluatorOptions) + var StderrLogger = NewLogger(os.Stdout) + var WithDefaultAllowedModules = func(opts *EvaluatorOptions) + var WithDefaultAllowedResources = func(opts *EvaluatorOptions) + var WithDefaultCacheDir = func(opts *EvaluatorOptions) + var WithFs = func(fs fs.FS, scheme string) func(opts *EvaluatorOptions) + var WithModuleReader = func(reader ModuleReader) func(opts *EvaluatorOptions) + var WithOsEnv = func(opts *EvaluatorOptions) + var WithProject = func(project *Project) func(opts *EvaluatorOptions) + var WithProjectDependencies = func(project *Project) func(opts *EvaluatorOptions) + var WithProjectEvaluatorSettings = func(project *Project) func(opts *EvaluatorOptions) + var WithResourceReader = func(reader ResourceReader) func(opts *EvaluatorOptions) + func ExecuteCommand(command string) (string, error) + func FormatLogMessage(level, message, frameUri string) string + func RegisterMapping(name string, value any) + func Unmarshal(data []byte, v any) error + type Checksums struct + Sha256 string + type Class struct + type DataSize struct + Unit DataSizeUnit + Value float64 + func (d *DataSize) String() string + func (d *DataSize) ToUnit(unit DataSizeUnit) DataSize + type DataSizeUnit int64 + func ToDataSizeUnit(str string) (DataSizeUnit, error) + func (d *DataSizeUnit) UnmarshalBinary(data []byte) error + func (d DataSizeUnit) String() string + type Duration struct + Unit DurationUnit + Value float64 + func (d *Duration) GoDuration() time.Duration + type DurationUnit int64 + func ToDurationUnit(str string) (DurationUnit, error) + func (d *DurationUnit) UnmarshalBinary(data []byte) error + func (d DurationUnit) String() string + type EvalError struct + ErrorOutput string + func (r *EvalError) Error() string + func (r *EvalError) Is(err error) bool + type Evaluator interface + Close func() error + Closed func() bool + EvaluateExpression func(ctx context.Context, source *ModuleSource, expr string, out interface{}) error + EvaluateExpressionRaw func(ctx context.Context, source *ModuleSource, expr string) ([]byte, error) + EvaluateModule func(ctx context.Context, source *ModuleSource, out any) error + EvaluateOutputFiles func(ctx context.Context, source *ModuleSource) (map[string]string, error) + EvaluateOutputText func(ctx context.Context, source *ModuleSource) (string, error) + EvaluateOutputValue func(ctx context.Context, source *ModuleSource, out any) error + func NewEvaluator(ctx context.Context, opts ...func(options *EvaluatorOptions)) (Evaluator, error) + func NewEvaluatorWithCommand(ctx context.Context, pklCmd []string, opts ...func(options *EvaluatorOptions)) (Evaluator, error) + func NewProjectEvaluator(ctx context.Context, projectDir string, ...) (Evaluator, error) + func NewProjectEvaluatorWithCommand(ctx context.Context, projectDir string, pklCmd []string, ...) (Evaluator, error) + type EvaluatorManager interface + Close func() error + GetVersion func() (string, error) + NewEvaluator func(ctx context.Context, opts ...func(options *EvaluatorOptions)) (Evaluator, error) + NewProjectEvaluator func(ctx context.Context, projectDir string, ...) (Evaluator, error) + func NewEvaluatorManager() EvaluatorManager + func NewEvaluatorManagerWithCommand(pklCommand []string) EvaluatorManager + type EvaluatorOptions struct + AllowedModules []string + AllowedResources []string + CacheDir string + DeclaredProjectDependencies *ProjectDependencies + Env map[string]string + Http *Http + Logger Logger + ModulePaths []string + ModuleReaders []ModuleReader + OutputFormat string + ProjectBaseURI string + Properties map[string]string + ResourceReaders []ResourceReader + RootDir string + type Http struct + CaCertificates []byte + Proxy *Proxy + type IntSeq struct + End int + Start int + Step int + type InternalError struct + func (r *InternalError) Error() string + func (r *InternalError) Is(err error) bool + func (r *InternalError) Unwrap() error + type Logger interface + Trace func(message string, frameUri string) + Warn func(message string, frameUri string) + func NewLogger(out io.Writer) Logger + type ModuleReader interface + IsLocal func() bool + Read func(url url.URL) (string, error) + type ModuleSource struct + Contents string + Uri *url.URL + func FileSource(pathElems ...string) *ModuleSource + func TextSource(text string) *ModuleSource + func UriSource(uri string) *ModuleSource + type Object struct + Elements []any + Entries map[any]any + ModuleUri string + Name string + Properties map[string]any + type Pair struct + First A + Second B + type PathElement interface + IsDirectory func() bool + Name func() string + func NewPathElement(name string, isDirectory bool) PathElement + type Project struct + EvaluatorSettings *ProjectEvaluatorSettings + Package *ProjectPackage + ProjectFileUri string + RawDependencies map[string]any + Tests []string + func LoadProject(context context.Context, path string) (*Project, error) + func LoadProjectFromEvaluator(context context.Context, ev Evaluator, path string) (*Project, error) + func (project *Project) Dependencies() *ProjectDependencies + type ProjectDependencies struct + LocalDependencies map[string]*ProjectLocalDependency + RemoteDependencies map[string]*ProjectRemoteDependency + type ProjectEvaluatorSettings struct + AllowedModules []string + AllowedResources []string + Env map[string]string + ExternalProperties map[string]string + Http *ProjectEvaluatorSettingsHttp + ModuleCacheDir string + ModulePath []string + NoCache *bool + RootDir string + Timeout Duration + type ProjectEvaluatorSettingsHttp struct + Proxy *ProjectEvaluatorSettingsProxy + type ProjectEvaluatorSettingsProxy struct + Address *string + NoProxy *[]string + type ProjectLocalDependency struct + Dependencies *ProjectDependencies + PackageUri string + ProjectFileUri string + type ProjectPackage struct + ApiTests []string + Authors []string + BaseUri string + Description string + Documentation string + Exclude []string + IssueTracker string + License string + LicenseText string + Name string + PackageZipUrl string + SourceCode string + SourceCodeUrlScheme string + Uri string + Version string + Website string + type ProjectRemoteDependency struct + Checksums *Checksums + PackageUri string + type Proxy struct + Address string + NoProxy []string + type Reader interface + HasHierarchicalUris func() bool + IsGlobbable func() bool + ListElements func(url url.URL) ([]PathElement, error) + Scheme func() string + type Regex struct + Pattern string + type ResourceReader interface + Read func(url url.URL) ([]byte, error) + type TypeAlias struct