exprreader

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package exprreader bluetape-go의 exprreader 기능을 제공한다.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidRuleDocument reports malformed YAML/JSON or schema validation.
	ErrInvalidRuleDocument = errors.New("exprreader rule document is invalid")
	// ErrInvalidRuleExpression reports expression parse, compile, or type-check failure.
	ErrInvalidRuleExpression = errors.New("exprreader rule expression is invalid")
	// ErrInvalidRuleAction reports unsupported or invalid declarative actions.
	ErrInvalidRuleAction = errors.New("exprreader rule action is invalid")
)

Functions

This section is empty.

Types

type Document

type Document struct {
	// Rules contains compiled rules in deterministic RuleSet order.
	Rules *rules.RuleSet
	// EngineConfig contains the optional sequential engine configuration.
	EngineConfig rules.EngineConfig
}

Document 패키지에서 공개하는 구조체다.

func Load

func Load(ctx context.Context, r io.Reader, options ...Option) (*Document, error)

Load key에 해당하는 값을 조회한다.

매개변수:

  • ctx: 호출자가 소유한 취소, deadline, 요청 범위를 전달한다.
  • r: Load에 전달되는 값이다. 허용 범위와 nil 처리 방식은 구현 검증을 따른다.
  • options: 적용할 옵션 목록이다. nil이면 기본값만 사용한다.

반환 오류는 입력 검증 실패와 패키지에서 정의한 sentinel error/typed error를 그대로 드러낸다.

type Option

type Option func(*config)

Option func 공개 타입이다.

func WithMaxNodes

func WithMaxNodes(maxNodes uint) Option

WithMaxNodes MaxNodes 설정을 적용한 옵션을 반환한다.

매개변수:

  • maxNodes: WithMaxNodes에 전달되는 값이다. 허용 범위와 nil 처리 방식은 구현 검증을 따른다.

type ReaderError

type ReaderError struct {
	RuleName string
	Field    string
	Err      error
}

ReaderError 패키지에서 공개하는 구조체다.

func (ReaderError) Error

func (e ReaderError) Error() string

Error 오류 메시지를 반환한다.

func (ReaderError) Unwrap

func (e ReaderError) Unwrap() error

Unwrap 감싼 원인 오류를 반환한다.

반환 오류는 입력 검증 실패와 패키지에서 정의한 sentinel error/typed error를 그대로 드러낸다.

Jump to

Keyboard shortcuts

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