internal

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func AllColsInList added in v0.29.0

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

Check if any one of the lists contains all the columns

func Delete added in v0.32.0

func Delete(from, to int) deleteRule

func EditCallback added in v0.32.0

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

func EditString added in v0.32.0

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

func EditStringSegment added in v0.32.0

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

func Except added in v0.40.0

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

Except drops the given column names from the column set

func FilterNonZero added in v0.15.0

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

func FirstNonEmpty added in v0.15.0

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

func Insert added in v0.32.0

func Insert(pos int, content string) insertRule

func InsertFromFunc added in v0.32.0

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

func Only added in v0.40.0

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

Only drops other column names from the column set

func Pointer added in v0.37.0

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

func RandInt added in v0.21.0

func RandInt() int64

func RemoveDuplicates added in v0.29.0

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

func Replace added in v0.32.0

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

func ReplaceFromFunc added in v0.32.0

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

func SliceMatch added in v0.29.0

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

func ToAnySlice added in v0.15.0

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

func ValOrZero added in v0.40.0

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

Types

type EditRule added in v0.32.0

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

func RecordPoint added in v0.41.1

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

func RecordPoints added in v0.32.0

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

type OutOfBoundsError added in v0.32.0

type OutOfBoundsError int

func (OutOfBoundsError) Error added in v0.32.0

func (e OutOfBoundsError) Error() string

func (OutOfBoundsError) Is added in v0.32.0

func (e OutOfBoundsError) Is(target error) bool

type RuleType added in v0.32.0

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

func (RuleType) String added in v0.32.0

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