Documentation
¶
Index ¶
- func BuildResultChan(query *types.Query, in chan map[string]any) (*types.Result, error)
- func BuildResultSync(query *types.Query, in []map[string]any) (*types.Result, error)
- func GetDependencyTree(adapter IAdapter, current string) (models.Graph, error)
- func IsValidJoin(adapter IAdapter, join *models.Join) error
- func RunChan(db *gorm.DB) (chan map[string]any, error)
- func RunSync(db *gorm.DB) ([]map[string]any, error)
- type AdapterOption
- type AdapterType
- type Clients
- func (c Clients) BuildDB(clause types.Clause) (*gorm.DB, error)
- func (c Clients) BuildSQL(clause types.Clause) (string, error)
- func (c Clients) Get(dbType types.DBType, dataset string) (*gorm.DB, error)
- func (c Clients) RegisterByKV(dbType types.DBType, dataset string, db *gorm.DB)
- func (c Clients) RegisterByOption(option ClientsOption) error
- func (c Clients) SetLogger(log logger.Interface)
- type ClientsOption
- type Configuration
- type DBOption
- type DependencyGraph
- type DependencyGraphBuilder
- type Dictionary
- type FileAdapter
- func (f *FileAdapter) BuildDataSourceAdapter(key string) (IAdapter, error)
- func (f *FileAdapter) GetDataSetByKey(key string) (*models.DataSet, error)
- func (f *FileAdapter) GetDimension() []*models.Dimension
- func (f *FileAdapter) GetDimensionByKey(key string) (*models.Dimension, error)
- func (f *FileAdapter) GetDimensionsBySource(key string) []*models.Dimension
- func (f *FileAdapter) GetMetric() []*models.Metric
- func (f *FileAdapter) GetMetricByKey(key string) (*models.Metric, error)
- func (f *FileAdapter) GetMetricsBySource(key string) []*models.Metric
- func (f *FileAdapter) GetSourceByKey(key string) (*models.DataSource, error)
- type IAdapter
- type Manager
- func (m *Manager) BuildSQL(query *types.Query) (string, error)
- func (m *Manager) BuildTransaction(query *types.Query) (*gorm.DB, error)
- func (m *Manager) GetClients() (Clients, error)
- func (m *Manager) GetDictionary() (*Dictionary, error)
- func (m *Manager) RunChan(query *types.Query) (*types.Result, error)
- func (m *Manager) RunSync(query *types.Query) (*types.Result, error)
- func (m *Manager) SetLogger(log logger.Interface)
- type NormalClauseSplitter
- func (n *NormalClauseSplitter) GetOtherCandidate() []*types.DataSource
- func (n *NormalClauseSplitter) GetOtherSplitQuery() map[string]*types.Query
- func (n *NormalClauseSplitter) GetSelfCandidate() *types.DataSource
- func (n *NormalClauseSplitter) GetSelfSplitQuery() *types.Query
- func (n *NormalClauseSplitter) Polish() map[string]*types.Query
- func (n *NormalClauseSplitter) Run() error
- type Option
- type Translator
- type TranslatorOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildResultChan ¶
func BuildResultSync ¶
func GetDependencyTree ¶
Types ¶
type AdapterOption ¶
type AdapterOption struct { Type AdapterType `json:"type"` Dsn string `json:"dsn"` }
AdapterOption Adapter配置
type Clients ¶
func NewClients ¶
func NewClients(option ClientsOption) (Clients, error)
func (Clients) RegisterByKV ¶
func (Clients) RegisterByOption ¶
func (c Clients) RegisterByOption(option ClientsOption) error
type ClientsOption ¶
type Configuration ¶
type Configuration struct { // configurations for clients, data_dictionary ClientsOption ClientsOption `json:"clients_option"` DictionaryOption *Option `json:"dictionary_option"` }
type DBOption ¶
type DependencyGraph ¶
type DependencyGraphBuilder ¶
type DependencyGraphBuilder struct {
// contains filtered or unexported fields
}
func (*DependencyGraphBuilder) Build ¶
func (g *DependencyGraphBuilder) Build() (DependencyGraph, error)
type Dictionary ¶
type Dictionary struct {
Adapter IAdapter
}
func NewDictionary ¶
func NewDictionary(option *Option) (*Dictionary, error)
func (*Dictionary) Translator ¶
func (d *Dictionary) Translator(query *types.Query) (Translator, error)
type FileAdapter ¶
type FileAdapter struct { Sets []*models.DataSet Sources []*models.DataSource Metrics []*models.Metric Dimensions []*models.Dimension }
FileAdapter 文件适配器
func (*FileAdapter) BuildDataSourceAdapter ¶
func (f *FileAdapter) BuildDataSourceAdapter(key string) (IAdapter, error)
func (*FileAdapter) GetDataSetByKey ¶
func (f *FileAdapter) GetDataSetByKey(key string) (*models.DataSet, error)
func (*FileAdapter) GetDimension ¶
func (f *FileAdapter) GetDimension() []*models.Dimension
func (*FileAdapter) GetDimensionByKey ¶
func (f *FileAdapter) GetDimensionByKey(key string) (*models.Dimension, error)
func (*FileAdapter) GetDimensionsBySource ¶
func (f *FileAdapter) GetDimensionsBySource(key string) []*models.Dimension
func (*FileAdapter) GetMetric ¶
func (f *FileAdapter) GetMetric() []*models.Metric
func (*FileAdapter) GetMetricByKey ¶
func (f *FileAdapter) GetMetricByKey(key string) (*models.Metric, error)
func (*FileAdapter) GetMetricsBySource ¶
func (f *FileAdapter) GetMetricsBySource(key string) []*models.Metric
func (*FileAdapter) GetSourceByKey ¶
func (f *FileAdapter) GetSourceByKey(key string) (*models.DataSource, error)
type IAdapter ¶
type IAdapter interface { BuildDataSourceAdapter(string) (IAdapter, error) GetMetric() []*models.Metric GetDimension() []*models.Dimension GetDataSetByKey(string) (*models.DataSet, error) GetSourceByKey(string) (*models.DataSource, error) GetMetricByKey(string) (*models.Metric, error) GetDimensionByKey(string) (*models.Dimension, error) GetMetricsBySource(string) []*models.Metric GetDimensionsBySource(string) []*models.Dimension }
IAdapter Adapter适配器
func NewAdapter ¶
func NewAdapter(option *AdapterOption) (IAdapter, error)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(configuration *Configuration) (*Manager, error)
func (*Manager) BuildTransaction ¶
func (*Manager) GetClients ¶
func (*Manager) GetDictionary ¶
func (m *Manager) GetDictionary() (*Dictionary, error)
type NormalClauseSplitter ¶
type NormalClauseSplitter struct { Translator Translator CandidateList []*types.DataSource Candidate map[string]*types.DataSource SplitQuery map[string]*types.Query Clause *types.NormalClause Query *types.Query DBType types.DBType }
func NewNormalClauseSplitter ¶
func NewNormalClauseSplitter(translator Translator, clause *types.NormalClause, query *types.Query, dbType types.DBType) (*NormalClauseSplitter, error)
func (*NormalClauseSplitter) GetOtherCandidate ¶
func (n *NormalClauseSplitter) GetOtherCandidate() []*types.DataSource
func (*NormalClauseSplitter) GetOtherSplitQuery ¶
func (n *NormalClauseSplitter) GetOtherSplitQuery() map[string]*types.Query
func (*NormalClauseSplitter) GetSelfCandidate ¶
func (n *NormalClauseSplitter) GetSelfCandidate() *types.DataSource
func (*NormalClauseSplitter) GetSelfSplitQuery ¶
func (n *NormalClauseSplitter) GetSelfSplitQuery() *types.Query
func (*NormalClauseSplitter) Polish ¶
func (n *NormalClauseSplitter) Polish() map[string]*types.Query
func (*NormalClauseSplitter) Run ¶
func (n *NormalClauseSplitter) Run() error
type Option ¶
type Option struct {
AdapterOption
}
type Translator ¶
type Translator interface { GetCurrent() string GetAdapter() IAdapter GetDependencyGraph() DependencyGraph Translate(*types.Query) (types.Clause, error) }
func NewTranslator ¶
func NewTranslator(option *TranslatorOption) (Translator, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.