datasources

package
v0.0.0-...-fb3163d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigField

type ConfigField struct {
	Name        string
	PrettyName  string
	Description string
	Required    bool
	Type        ConfigFieldType
	Options     *[]FieldOption
	Checked     bool
	Default     string
	Value       string
	Placeholder string
}

type ConfigFieldType

type ConfigFieldType string
const (
	Text     ConfigFieldType = "Text"
	TextArea ConfigFieldType = "TextArea"
	Checkbox ConfigFieldType = "Checkbox"
	Radio    ConfigFieldType = "Radio"
	Password ConfigFieldType = "Password"
)

type Datasource

type Datasource interface {
	GetConfigFields() []ConfigField
}

type DatasourceIndexPayload

type DatasourceIndexPayload struct {
	ID     int
	Type   string
	Config string
}

type DatasourceIndexer

type DatasourceIndexer struct {
	Config *config.Config
	ORM    *ent.Client
	Tasks  *services.TaskClient
}

func (*DatasourceIndexer) InitORM

func (d *DatasourceIndexer) InitORM()

func (*DatasourceIndexer) InitTasks

func (d *DatasourceIndexer) InitTasks()

type DatasourceInfo

type DatasourceInfo struct {
	ID         string
	PrettyName string
	New        func() Datasource
}

type DatasourceRegistry

type DatasourceRegistry struct {
	Sources []DatasourceInfo
}

func GetDatasourceRegistry

func GetDatasourceRegistry() *DatasourceRegistry

func (*DatasourceRegistry) Get

Get a datasource from the registry given its id. If the datasource does not exist, nil is returned

func (*DatasourceRegistry) Register

func (d *DatasourceRegistry) Register(dsInfo DatasourceInfo) error

Register the given datasource with the registry. If the datasource already exists an error is thrown

type FieldOption

type FieldOption struct {
	Text  string
	Value string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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