cherryDataConfig

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(table string, value interface{})

func EqualList

func EqualList(table string, key string, value interface{}) interface{}

func EqualOne

func EqualOne(table string, key string, value interface{}) interface{}

func List

func List(table string) interface{}

func Or

func Or(table string, params map[string]interface{}, out interface{}) error

Types

type DataConfigComponent

type DataConfigComponent struct {
	cherryInterfaces.BaseComponent
	// contains filtered or unexported fields
}

func NewComponent

func NewComponent() *DataConfigComponent

func (*DataConfigComponent) CheckFileName

func (d *DataConfigComponent) CheckFileName(fileNames string, text []byte) error

func (*DataConfigComponent) GetFirst

func (d *DataConfigComponent) GetFirst(index *IndexObject, params ...interface{}) interface{}

func (*DataConfigComponent) GetIndexList

func (d *DataConfigComponent) GetIndexList(index *IndexObject, params ...interface{}) interface{}

func (*DataConfigComponent) GetList

func (d *DataConfigComponent) GetList(tableName string) interface{}

func (*DataConfigComponent) Init

func (d *DataConfigComponent) Init()

func (*DataConfigComponent) RegisterModel

func (d *DataConfigComponent) RegisterModel(models ...IConfigModel) error

func (*DataConfigComponent) RegisterService

func (d *DataConfigComponent) RegisterService(service IConfigService)

func (*DataConfigComponent) Reload

func (d *DataConfigComponent) Reload(fileName string, text []byte) error

type IConfigModel

type IConfigModel interface {
	FileName() string

	Init()
}

type IConfigService

type IConfigService interface {
	Clean(typ interface{})

	Init(dataConfig IDataConfig)
}

type IDataConfig

type IDataConfig interface {
	GetFirst(index *IndexObject, params ...interface{}) interface{}

	GetList(tableName string) interface{}

	GetIndexList(index *IndexObject, params ...interface{}) interface{}

	Reload(fileName string, text []byte) error

	CheckFileName(fileName string, text []byte) error

	RegisterModel(models ...IConfigModel) error

	RegisterService(service IConfigService)
}

type IDataParse

type IDataParse interface {
	Parse(text []byte, v interface{}) error
}

type IDataSource

type IDataSource interface {
	Name() string

	Init()

	Destroy()

	SetParse(parse IDataParse)

	GetContent(fileName string) ([]byte, error)

	GetConfigNames() []string
}

type IndexObject

type IndexObject struct {
	TableName string
	IndexName string
	Columns   []string
}

func Build

func Build(tableName string, indexKey ...string) *IndexObject

func NewIndex

func NewIndex(tableName, key string) *IndexObject

func (*IndexObject) String

func (i *IndexObject) String() string

type Json

type Json struct {
}

func (*Json) Parse

func (j *Json) Parse(text []byte, v interface{}) error

type LocalSource

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

func (*LocalSource) Destroy

func (l *LocalSource) Destroy()

func (*LocalSource) GetConfigNames

func (l *LocalSource) GetConfigNames() []string

func (*LocalSource) GetContent

func (l *LocalSource) GetContent(fileName string) ([]byte, error)

func (*LocalSource) Init

func (l *LocalSource) Init()

func (*LocalSource) Name

func (l *LocalSource) Name() string

func (*LocalSource) SetParse

func (l *LocalSource) SetParse(parse IDataParse)

type Storage

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

type Xml

type Xml struct {
}

func (*Xml) Parse

func (j *Xml) Parse(text []byte, v interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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