tsv

package
v0.0.0-...-595b576 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf[K cmp.Ordered, V any] struct {
	// contains filtered or unexported fields
}

Conf 表示单个tsv配置表

func New

func New[K cmp.Ordered, V any](dir string) (*Conf[K, V], error)

New 根据struct原型创建Tsv

func (*Conf[K, V]) Filter

func (tsv *Conf[K, V]) Filter(filter func(line V) bool) []V

Filter 筛选符合条件的记录,返回所有匹配的数据

func (*Conf[K, V]) Get

func (tsv *Conf[K, V]) Get(id K) V

Get 通过Index Key读取单行记录

func (*Conf[K, V]) GetAll

func (tsv *Conf[K, V]) GetAll() []V

func (*Conf[K, V]) Name

func (tsv *Conf[K, V]) Name() string

func (*Conf[K, V]) NumRecord

func (tsv *Conf[K, V]) NumRecord() int

NumRecord 返回tsv行数

func (*Conf[K, V]) Reload

func (tsv *Conf[K, V]) Reload() error

Reload 从文件中重新读取并填充配置表数据

func (*Conf[K, V]) Select

func (tsv *Conf[K, V]) Select(filter func(line V) bool) (V, error)

Select 筛选符合条件的记录,只返回第一个匹配的数据

Jump to

Keyboard shortcuts

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