refertable

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package refertable for saving external data

Index

Constants

View Source
const (
	SchemeHTTP  = "http"
	SchemeHTTPS = "https"

	PullDuration = time.Second
)

Variables

This section is empty.

Functions

func ColType2SqliteType

func ColType2SqliteType(typeName string) string

func InitLog

func InitLog()

Types

type InConfig

type InConfig struct {
	URL      string        `toml:"url"`
	Interval time.Duration `toml:"interval"`
}

type PlReferTables

type PlReferTables interface {
	Query(tableName string, colName []string, colValue []any, kGet []string) (map[string]any, bool)

	Stats() *ReferTableStats
	// contains filtered or unexported methods
}

type PlReferTablesInMemory

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

func (*PlReferTablesInMemory) Query

func (plrefer *PlReferTablesInMemory) Query(tableName string, colName []string, colValue []any,
	kGet []string,
) (map[string]any, bool)

func (*PlReferTablesInMemory) Stats

func (plrefer *PlReferTablesInMemory) Stats() *ReferTableStats

type PlReferTablesSqlite

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

func (*PlReferTablesSqlite) Query

func (p *PlReferTablesSqlite) Query(tableName string, colName []string, colValue []any, kGet []string) (map[string]any, bool)

func (*PlReferTablesSqlite) Stats

type RefTbCfg

type RefTbCfg struct {
	// table data pull config
	URL      string
	Interval time.Duration

	// table store config
	UseSQLite     bool
	SQLiteMemMode bool
	DBPath        string
}

type ReferTable

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

func NewReferTable

func NewReferTable(cfg RefTbCfg) (*ReferTable, error)

func (*ReferTable) InitFinished

func (refT *ReferTable) InitFinished(waitTime time.Duration) bool

InitFinished used to check init status.

func (*ReferTable) PullWorker

func (refT *ReferTable) PullWorker(ctx context.Context)

func (*ReferTable) Tables

func (refT *ReferTable) Tables() PlReferTables

type ReferTableStats

type ReferTableStats struct {
	Name []string
	Row  []int
}

Jump to

Keyboard shortcuts

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