search

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 6 Imported by: 1

README

chefgo search module.

Documentation

Index

Constants

View Source
const (
	NAME    = "SEARCH"
	DEFAULT = "default"
)

Variables

This section is empty.

Functions

func Base

func Base(name string, conns ...string) *searchBase

func Configure

func Configure(cfg Map)

Configure 更新配置

func Go

func Go()

Go 直接开跑 此方法只单独使用模块时用

func Index

func Index(base string, docs ...Map) error

func IndexTo

func IndexTo(conn string, base string, docs ...Map) error

func Query

func Query(base string, offset, limit int64, query string) (int64, []Map, error)

func QueryFrom

func QueryFrom(conn string, base string, offset, limit int64, query string) (int64, []Map, error)

func Ready

func Ready()

Ready 准备运行 此方法只单独使用模块时用

func Register

func Register(name string, value Any, overrides ...bool)

Register 开放给外

Types

type Config

type Config struct {
	Driver  string
	Weight  int
	Prefix  string
	Expiry  time.Duration
	Setting Map
}

type Configs

type Configs map[string]Config

type Connect

type Connect interface {
	//打开、关闭
	Open() error
	Close() error

	Index(string, ...Map) error
	Query(string, int64, int64, string) (int64, []Map, error)
}

Connect 会话连接

type Driver

type Driver interface {
	Connect(name string, config Config) (Connect, error)
}

Driver 数据驱动

type Instance

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

type Module

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

func (*Module) Config

func (this *Module) Config(name string, config Config, override bool)

func (*Module) Configs

func (this *Module) Configs(config Configs, override bool)

func (*Module) Configure

func (this *Module) Configure(global Map)

func (*Module) Connect

func (this *Module) Connect()

func (*Module) Driver

func (module *Module) Driver(name string, driver Driver, override bool)

Driver 注册驱动

func (Module) Index

func (this Module) Index(base string, docs ...Map) error

func (Module) IndexTo

func (this Module) IndexTo(conn string, base string, docs ...Map) error

func (*Module) Initialize

func (this *Module) Initialize()

func (*Module) Launch

func (this *Module) Launch()

func (Module) Query

func (this Module) Query(base string, offset, limit int64, query string) (int64, []Map, error)

func (Module) QueryFrom

func (this Module) QueryFrom(conn string, base string, offset, limit int64, query string) (int64, []Map, error)

func (*Module) Register

func (this *Module) Register(name string, value Any, override bool)

func (*Module) Terminate

func (this *Module) Terminate()

Jump to

Keyboard shortcuts

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