database

package
v0.0.0-...-687c1ae Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRDBMSConnection

func NewRDBMSConnection(c RDBMSConfig) (*gorm.DB, error)

NewRDBMSConnection returns a DB object based on config provided

Types

type DBType

type DBType int

DBType is just a renamed int

const (
	SQLITE DBType = 0
	MYSQL  DBType = 1
)

DBType constants

type InfluxDB

type InfluxDB interface {
	Config() InfluxDBConfig
	Client() influxdb2.Client
	Close()
	WriteAPI() api.WriteAPI
	WriteAPIBlocking() api.WriteAPIBlocking
	QueryAPI(org string) api.QueryAPI
	Write(s *StatusPoint)
	WriteBlocking(s *StatusPoint) error
}

InfluxDB is a interface provided basic APIs

func NewInfluxDBConnection

func NewInfluxDBConnection(c InfluxDBConfig) (InfluxDB, error)

NewInfluxDBConnection is used to start a InfluxDB connection

type InfluxDBConfig

type InfluxDBConfig struct {
	Token   string
	URL     string
	Org     string
	Bucket  string
	Options *influxdb2.Options
}

InfluxDBConfig is a Config for starting InfluxDB Connection

type RDBMSConfig

type RDBMSConfig struct {
	Type         DBType
	SQLiteConfig sqliteConfig
	MySQLConfig  mysqlConfig
}

RDBMSConfig is the config used to start a DB connection

type StatusPoint

type StatusPoint struct {
	Up         int
	NodeID     int
	EndpointID int
}

StatusPoint is a struct to write into InfluxDB

Jump to

Keyboard shortcuts

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