Discover Packages
github.com/AlexTransit/venderctl
internal
tele
config
package
Version:
v0.250127.0
Opens a new window with list of versions in this module.
Published: Jan 27, 2025
License: CC0-1.0
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Separate package is workaround to import cycles.
type Config struct {
ExecOnState string `hcl:"exec_on_state"`
LogDebug bool `hcl:"log_debug"`
MqttLogDebug bool `hcl:"mqtt_log_debug"`
MqttBroker string `hcl:"mqtt_broker"`
TLS TLS `hcl:"tls"`
Connect *Connect `hcl:"connect"`
Listens []Listen `hcl:"listen"`
RoleMembersAdmin []string `hcl:"role_admin"`
RoleMembersControl []string `hcl:"role_control"`
RoleMembersMonitor []string `hcl:"role_monitor"`
SecretsPath string `hcl:"secrets"`
Mode Mode `hcl:"-"`
}
Prepare Config in client mode. Use endpoint Connect if available or first Listen allowing the role.
type Connect struct {
ClientID string `hcl:"clientid"`
URL string `hcl:"url"`
TLS TLS `hcl:"tls"`
KeepaliveSec int `hcl:"keepalive_sec"`
PingTimeoutSec int `hcl:"ping_timeout_sec"`
NetworkTimeoutSec int `hcl:"network_timeout_sec"`
}
type Listen struct {
URL string `hcl:"url,key"`
TLS TLS `hcl:"tls"`
KeepaliveSec int `hcl:"keepalive_sec"`
NetworkTimeoutSec int `hcl:"network_timeout_sec"`
AllowRoles []string `hcl:"allow_roles"`
}
const (
ModeDisabled Mode = ""
ModeClient Mode = "client"
ModeServer Mode = "server"
ModeTax Mode = "tax"
ModeCommand Mode = "command"
ModeSponge Mode = "sponge"
ModeTelegram Mode = "telegram"
)
const (
RoleInvalid Role = ""
RoleAll Role = "_all"
RoleAdmin Role = "admin"
RoleControl Role = "control"
RoleMonitor Role = "monitor"
RoleVender Role = "vender"
)
type TLS struct {
CaFile string `hcl:"ca_file"`
PSK string `hcl:"psk"`
CertFile string `hcl:"cert_file"`
KeyFile string `hcl:"key_file"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.