restore

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine handles placeholder restoration

func NewEngine

func NewEngine(s *session.Manager, prefix string) *Engine

NewEngine creates a new restoration engine

func (*Engine) MatchAt

func (e *Engine) MatchAt(input []byte, start int) (end int, ok bool)

MatchAt checks whether input[start:] begins with a "complete placeholder"; if so, it returns the end position. This is used for streaming boundary detection to avoid emitting an incomplete prefix fragment that can no longer be restored.

func (*Engine) Prefix

func (e *Engine) Prefix() string

Prefix returns the placeholder prefix (e.g. "__VG_").

func (*Engine) Restore

func (e *Engine) Restore(input []byte) []byte

Restore replaces placeholders with original values

func (*Engine) RestoreString

func (e *Engine) RestoreString(input string) string

RestoreString is a convenience method for string input

Jump to

Keyboard shortcuts

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