schema

package
v0.0.0-...-b4c1251 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseSchemaList

func ParseSchemaList(cfgList []config.SchemaConfig) (map[string]*Schema, error)

Types

type Node

type Node struct {
	Master           *backend.DB
	Slave            []*backend.DB
	DownAfterNoAlive time.Duration

	Cfg config.NodeConfig

	Online bool
}

type Schema

type Schema struct {
	Name        string
	DefaultNode *config.NodeConfig

	NodeMap map[string]*config.NodeConfig
	//TableCfgMap map[string]*config.TableConfig
	RuleMap     map[string]*router.Rule
	TableCfgMap map[string]*config.TableConfig

	Router *router.Router

	BackendNode        map[string]*backend_node.Node
	DefaultBackendNode *backend_node.Node
	// contains filtered or unexported fields
}

func ParseSchema

func ParseSchema(cfg *config.SchemaConfig) (*Schema, error)

func (*Schema) FindNodeIndex

func (s *Schema) FindNodeIndex(rule *router.Rule, key interface{}) (int, error)

Jump to

Keyboard shortcuts

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