config

package
v0.0.0-...-d221b79 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//Couch .
	Couch = "couch"
	//Elk  .
	Elk = "elk"
)
View Source
const (
	//Room .
	Room = "room"

	//Device .
	Device = "device"
)
View Source
const (
	ALL   = "all"
	DELTA = "delta"

	DEVICE = "device"
	ROOM   = "room"
	EVENT  = "event"

	LEGACY  = "legacy"
	DEFAULT = "default"

	ELKSTATIC     = "elkstatic"
	ELKTIMESERIES = "elktimeseries"
	COUCH         = "couch"
	WEBSOCKET     = "websocket"

	WEEKLY   = "weekly"
	DAILY    = "daily"
	MONTHLY  = "monthly"
	YEARLY   = "yearly"
	NOROTATE = "norotate"
)

Variables

This section is empty.

Functions

func Contains

func Contains(a []string, b string) bool

Contains .

func ReplaceEnv

func ReplaceEnv(s string) string

Types

type Cache

type Cache struct {
	Name string `json:"name"`

	//Persistence type
	StorageType string `json:"storage-type"`

	//Legacy or Defautl
	CacheType string `json:"cache-type"`

	CouchInfo CouchCache `json:"couch-cache"`
	ELKinfo   ElkCache   `json:"elk-cache"`
	RedisInfo RedisCache `json:"redis-cache"`
}

Cache .

type Config

type Config struct {
	Forwarders []Forwarder `json:"forwarders"`
	Caches     []Cache     `json:"caches"`
}

Config .

func GetConfig

func GetConfig() Config

GetConfig .

type CouchCache

type CouchCache struct {
	DatabaseName string `json:"database-name"`
	URL          string `json:"url"`
}

CouchCache .

type CouchForwader

type CouchForwader struct {
	URL          string `json:"url"`
	DatabaseName string `json:"database-name"`
}

CouchForwader .

type ElkCache

type ElkCache struct {
	DeviceIndex string `json:"device-index"`
	RoomIndex   string `json:"room-index"`
	URL         string `json:"url"`
}

ElkCache .

type ElkForwarder

type ElkForwarder struct {
	URL          string `json:"url"`
	IndexPattern string `json:"index-pattern"`
	Upsert       bool   `json:"upsert"`

	//Supported Values:
	//daily, weekly, monthly, yearly
	IndexRotationInterval string `json:"index-rotation-interval"`
}

ElkForwarder .

type Forwarder

type Forwarder struct {
	Name string `json:"name"`

	//SupportedValues:
	//elkstatic, elktimeseries, couch
	Type string `json:"type"`

	//Supported Values:
	//delta, all
	EventType string `json:"event-type"`

	//Interval in seconds between change pushes
	Interval int `json:"interval"`

	//Supported Values:
	//device, event
	DataType string `json:"data-type"`

	//Supported Values;
	//legacy, default
	CacheName string `json:"cache-name"`

	Couch CouchForwader `json:"couch"`
	Elk   ElkForwarder  `json:"elk"`
}

Forwarder .

type RedisCache

type RedisCache struct {
	DevDatabase  int    `json:"device-database"`
	RoomDatabase int    `json:"room-database"`
	Password     string `json:"password"`
	URL          string `json:"url"`
}

RedisCache .

Jump to

Keyboard shortcuts

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