loader

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ENTRY_JSON = "entry.json"

Variables

This section is empty.

Functions

func GetBase

func GetBase(ctx context.Context) string

GetBase 获取 loader 的 base path

func GetLogID

func GetLogID(ctx context.Context) string

GetLogID 获取 LogID

func GetScope

func GetScope(ctx context.Context) map[string]any

GetScope 获取 loader 的查询范围

func ResetDefaultGroup

func ResetDefaultGroup(groups map[string]source.Group) source.Group

func WithBase

func WithBase(ctx context.Context, base string) context.Context

WithBase 设置 loader 的 base path(用于 JSON/EMBED)

func WithLogID

func WithLogID(ctx context.Context, logID string) context.Context

WithLogID 设置 LogID(统一日志使用)

func WithScope

func WithScope(ctx context.Context, scope map[string]any) context.Context

WithScope 设置 loader 的查询范围(用于 MYSQL/MONGO)

Types

type EmbedLoader

type EmbedLoader struct {
	JSONLoader
	// contains filtered or unexported fields
}

func (*EmbedLoader) Init

func (self *EmbedLoader) Init() error

func (*EmbedLoader) Load

func (self *EmbedLoader) Load(ctx context.Context, name string) (*source.Value, error)

type ILoader

type ILoader interface {
	Load(ctx context.Context, model string) (*source.Value, error)
}

func NewLoader

func NewLoader(name string) ILoader

type JSONLoader

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

func (*JSONLoader) Init

func (self *JSONLoader) Init() error

func (*JSONLoader) Load

func (self *JSONLoader) Load(ctx context.Context, name string) (*source.Value, error)

type MongoLoader

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

func (*MongoLoader) Init

func (self *MongoLoader) Init() error

func (*MongoLoader) Load

func (self *MongoLoader) Load(ctx context.Context, model string) (*source.Value, error)

type MySQLLoader

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

func (*MySQLLoader) Init

func (self *MySQLLoader) Init() error

func (*MySQLLoader) Load

func (self *MySQLLoader) Load(ctx context.Context, model string) (*source.Value, error)

type SchemaTableName

type SchemaTableName struct {
	Model string
	Table string
	Input string
	XRule string

	Field string
	Group string
}

Jump to

Keyboard shortcuts

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