config

package
v0.0.0-...-f611648 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConfigFilePath = "/etc/driver/res/configuration.toml"
	Core                  = "Core"
	MQTTBroker            = "MQTTBroker"
)

Variables

View Source
var FilePath string

Functions

This section is empty.

Types

type ClientInfo

type ClientInfo struct {
	Address string
	// 是否启用tls
	UseTLS bool
	// ca cert
	CertFilePath string
	// mqtt clientId
	ClientId string
	// mqtt username
	Username string
	// mqtt password
	Password string
}

type DriverConfig

type DriverConfig struct {
	Logger      LogConfig
	Clients     map[string]ClientInfo
	Service     ServiceInfo
	CustomParam string
}

func ParseConfig

func ParseConfig() (*DriverConfig, error)

func (*DriverConfig) GetServiceID

func (d *DriverConfig) GetServiceID() string

func (*DriverConfig) ValidateConfig

func (d *DriverConfig) ValidateConfig() error

type LogConfig

type LogConfig struct {
	FileName string
	LogLevel string
}

type RPCConfig

type RPCConfig struct {
	Address  string
	UseTLS   bool
	CertFile string
	KeyFile  string
}

type ServiceInfo

type ServiceInfo struct {
	ID     string
	Name   string
	Server RPCConfig
	GwId   string
}

Jump to

Keyboard shortcuts

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