config

package
v0.0.0-...-886a5b3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = DefaultConfig()
View Source
var EnableEmu = false

Functions

func Parse

func Parse()

Types

type BadgerDB

type BadgerDB struct {
	Path     string `toml:"path"`
	InMemory bool   `toml:"in_memory"`
}

type ConfigStruct

type ConfigStruct struct {
	Debug       bool        `toml:"debug"`
	DeviceID    string      `toml:"device_id"`
	Secret      string      `toml:"secret"`
	DB          DB          `toml:"db"`
	BadgerDB    BadgerDB    `toml:"badger"`
	NodeClient  GRPCClient  `toml:"node"`
	EdgeService GRPCService `toml:"edge"`
	SlotService GRPCService `toml:"slot"`
	Sync        Sync        `toml:"sync"`
	Status      Status      `toml:"status"`
	Gin         Gin         `toml:"gin"`
	WebService  HttpService `toml:"web"`
	ApiService  HttpService `toml:"api"`
	Statics     []Static    `toml:"static"`
	Upload      Upload      `toml:"upload"`
	Slim        Slim        `toml:"slim"`
	Source      Source      `toml:"source"`
}

func DefaultConfig

func DefaultConfig() ConfigStruct

func (*ConfigStruct) Validate

func (c *ConfigStruct) Validate() error

type DB

type DB struct {
	Debug bool   `toml:"debug"`
	File  string `toml:"file"`
}

type GRPCClient

type GRPCClient struct {
	Enable             bool   `toml:"enable"`
	Addr               string `toml:"addr"`
	TLS                bool   `toml:"tls"`
	CA                 string `toml:"ca"`
	Cert               string `toml:"cert"`
	Key                string `toml:"key"`
	ServerName         string `toml:"server_name"`
	InsecureSkipVerify bool   `toml:"insecure_skip_verify"`
}

type GRPCService

type GRPCService struct {
	Enable bool   `toml:"enable"`
	Addr   string `toml:"addr"`
	TLS    bool   `toml:"tls"`
	CA     string `toml:"ca"`
	Cert   string `toml:"cert"`
	Key    string `toml:"key"`
}

type Gin

type Gin struct {
	Debug bool `toml:"debug"`
}

type HttpService

type HttpService struct {
	Enable bool   `toml:"enable"`
	Debug  bool   `toml:"debug"`
	Addr   string `toml:"addr"`
	TLS    bool   `toml:"tls"`
	CA     string `toml:"ca"`
	Cert   string `toml:"cert"`
	Key    string `toml:"key"`
}

type Slim

type Slim struct {
	Enable   bool   `toml:"enable"`
	Interval int    `toml:"interval"`
	BBolt    string `toml:"bbolt"`
	CacheTTL int    `toml:"cache_ttl"`
}

type Source

type Source struct {
	Enable       bool `toml:"enable"`
	Interval     int  `toml:"interval"`
	ReadInterval int  `toml:"read_interval"`
	GoS7         bool `toml:"gos7"`
	Modbus       bool `toml:"modbus"`
}

type Static

type Static struct {
	Enable bool   `toml:"enable"`
	Addr   string `toml:"addr"`
	Path   string `toml:"path"`
	TLS    bool   `toml:"tls"`
	Cert   string `toml:"cert"`
	Key    string `toml:"key"`
}

type Status

type Status struct {
	LinkTTL int `toml:"link_ttl"`
}

type Sync

type Sync struct {
	TokenRefresh int  `toml:"token_refresh"`
	Link         int  `toml:"link"`
	Interval     int  `toml:"interval"`
	Realtime     bool `toml:"realtime"`
}

type Upload

type Upload struct {
	Enable   bool `toml:"enable"`
	Interval int  `toml:"interval"`
	Batch    int  `toml:"batch"`
}

Jump to

Keyboard shortcuts

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