internal

package
v0.42.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TypesReplacer = strings.NewReplacer(
	" ", "_",
	".", "_",
	",", "_",
	"*", "_",
	"[", "_",
	"]", "_",
)

Functions

func AllColsInList

func AllColsInList(cols []string, lists ...[]string) bool

Check if any one of the lists contains all the columns

func Delete

func Delete(from, to int) deleteRule

func EditCallback

func EditCallback(rule EditRule, callbacks ...func(start, end int, before, after string) error) callbackRule

func EditString

func EditString(s string, rules ...EditRule) (string, error)

func EditStringSegment

func EditStringSegment(s string, from, to int, rules ...EditRule) (string, error)

func Except

func Except[T comparable](src []T, excludes ...T) []T

Except drops the given column names from the column set

func FilterNonZero

func FilterNonZero[T comparable](s []T) []T

func FirstNonEmpty

func FirstNonEmpty[T comparable, Ts ~[]T](slice Ts) T

func Insert

func Insert(pos int, content string) insertRule

func InsertFromFunc

func InsertFromFunc(pos int, content func() string) insertRule

func Only

func Only[T comparable](src []T, includes ...T) []T

Only drops other column names from the column set

func Pointer

func Pointer[T any](val T) *T

func RandInt

func RandInt() int64

func RemoveDuplicates

func RemoveDuplicates[T comparable, Ts ~[]T](slice Ts) Ts

func Replace

func Replace(from, to int, content string) replaceRule

func ReplaceFromFunc

func ReplaceFromFunc(from, to int, content func() string) replaceRule

func SliceMatch

func SliceMatch[T comparable, Ts ~[]T](a, b Ts) bool

func ToAnySlice

func ToAnySlice[T any, Ts ~[]T](slice Ts) []any

func ValOrZero

func ValOrZero[T comparable](val *T) T

Types

type EditRule

type EditRule interface {
	// contains filtered or unexported methods
}

func RecordPoint

func RecordPoint(point int, callbacks ...func(point int) error) EditRule

func RecordPoints

func RecordPoints(oldStart, oldEnd int, callbacks ...func(start, end int) error) []EditRule

type OutOfBoundsError

type OutOfBoundsError int

func (OutOfBoundsError) Error

func (e OutOfBoundsError) Error() string

func (OutOfBoundsError) Is

func (e OutOfBoundsError) Is(target error) bool

type RuleType

type RuleType int
const (
	InsertRuleType RuleType = iota
	DeleteRuleType
	ReplaceRuleType
)

func (RuleType) String

func (r RuleType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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