opts

package
v0.0.0-...-5b88717 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package opts is an internal package that exists for setting configuration settings for FHIRPath. This is an internal package so that only parts of this may be publicly re-exported, while the implementation has access to the full thing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyOptions

func ApplyOptions[T any](cfg *T, opts ...Option[T]) (*T, error)

ApplyOptions applies all the options to the given configuration.

Types

type CompileConfig

type CompileConfig struct {
	// Table is the current function table to be called.
	Table     funcs.FunctionTable
	Transform parser.VisitorTransform

	// Permissive is a legacy option to allow FHIRpaths with *invalid* fields to be
	// compiled (to reduce breakages).
	Permissive bool
}

CompileConfig provides the configuration values for the Compile command.

type CompileOption

type CompileOption = Option[CompileConfig]

CompileOption is an Option that sets CompileConfig.

type EvaluateConfig

type EvaluateConfig struct {
	// Context is the current context information.
	Context *expr.Context
}

EvaluateConfig provides the configuration values for the Evaluate command.

type EvaluateOption

type EvaluateOption = Option[EvaluateConfig]

EvaluateOption is an Option that sets EvaluateConfig.

type Option

type Option[T any] interface {
	// contains filtered or unexported methods
}

Option is the base interface for FHIRPath options.

func Transform

func Transform[T any](callback func(cfg *T) error) Option[T]

Transform creates either an Evaluate or Compile configuration option, done as a function callback.

Jump to

Keyboard shortcuts

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