chronus

package
v0.0.0-...-cba6ad5 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ChronusSinkId = "ChronusSinkId"
View Source
const SinkChronusHashTableKey = "rulemanager-sinks-chronus"
View Source
const SinkLogChronus = "[SinkChronus]"

Variables

View Source
var EmptySQL = ""
View Source
var EnumBaseFieldTypes []action_sink.BaseFieldType = []action_sink.BaseFieldType{
	{
		Name:        "Int8",
		LengthLimit: false,
	},
	{
		Name:        "Int16",
		LengthLimit: false,
	},
	{
		Name:        "Int32",
		LengthLimit: false,
	},
	{
		Name:        "Int64",
		LengthLimit: false,
	},
	{
		Name:        "UInt8",
		LengthLimit: false,
	},
	{
		Name:        "UInt16",
		LengthLimit: false,
	},
	{
		Name:        "UInt32",
		LengthLimit: false,
	},
	{
		Name:        "UInt64",
		LengthLimit: false,
	},
	{
		Name:        "Float32",
		LengthLimit: false,
	},
	{
		Name:        "Float64",
		LengthLimit: false,
	},
	{
		Name:        "String",
		LengthLimit: false,
	},
	{
		Name:        "Date",
		LengthLimit: false,
	},
}

Functions

func Connect

func Connect(ctx context.Context, endpoints []string, database string) error

func CreateTable

func CreateTable(ctx context.Context, conf *TableConfigs) (string, error)

create table.

func GenerateSql

func GenerateSql(ctx context.Context, conf *TableConfigs) (string, error)

generate sql.

func GetTableFieldTypes

func GetTableFieldTypes() []string

func ListTable

func ListTable(ctx context.Context, endpoints []string) ([]action_sink.Table, error)

func TableInfo

func TableInfo(ctx context.Context, endpoints []string, tableName string) (action_sink.Table, error)

Types

type ActionConfig

type ActionConfig struct {
	SinkId    string
	ActionId  string
	DbName    string
	TableName string
	Urls      []string
}

type MapField

type MapField struct {
	TFieldName string     `json:"tfield_name" mapstructure:"tfield_name"`
	MField     ModelField `json:"mfield" mapstructure:"mfield"`
}

type ModelConfigs

type ModelConfigs struct {
	DeviceName []string
	DeviceId   []string
	ThingId    string
}

type ModelField

type ModelField struct {
	Name string `json:"name" mapstructure:"name"`
	Type string `json:"type" mapstructure:"type"`
}

type Table

type Table struct {
	Name   string
	Fields []action_sink.TableField
}

func (Table) GetFields

func (t Table) GetFields() []action_sink.TableField

func (Table) GetName

func (t Table) GetName() string

type TableConfigs

type TableConfigs struct {
	Name       string
	Database   string
	Endpoints  []string
	Partitions []string
	Fields     []TableField
}

type TableField

type TableField struct {
	Name string
	Type string
	IsPK bool
}

func (TableField) GetName

func (tf TableField) GetName() string

func (TableField) GetType

func (tf TableField) GetType() string

func (TableField) ISPK

func (tf TableField) ISPK() bool

Jump to

Keyboard shortcuts

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