agent

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEF_WG_IFACE string = "wg0"
	DEF_WG_ETH   string = "eth"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	AgentType uint8             `yaml:"agent_type"` // pop or connector, WG_AGENT_TYPE_POP = 1; WG_AGENT_TYPE_CONNECTOR = 2; WG_AGENT_TYPE_CLIENT = 3
	AgentId   string            `yaml:"agent_id"`   // pop id or connector
	Api       ApiConfig         `yaml:"api"`        // server api
	Log       *logger.LogModule `yaml:"log"`        //
	Version   string            `yaml:"version"`
	Env       string            `yaml:"env"`
	HostName  string            `yaml:"host_name"`
	MqCfg     *AgentMqConfig    `yaml:"mq"` // mq 不用放在mtls之后的register里返回,register只是返回wg 信息,mq和api配置信息一样,配置了通常不会变化
}

config can be downloaded from web ui

func (*AgentConfig) GetWgAgentLogCfg

func (c *AgentConfig) GetWgAgentLogCfg() *logger.LogModule

type AgentMqConfig

type AgentMqConfig struct {
	Host        string `yaml:"host"`         // mq host, may equal=ApiHost
	Port        int    `yaml:"port"`         // mq port, diff with RegisterPort
	SubProtocol string `yaml:"sub_protocol"` // for message q, message-queue-v1
}

type AgentWgConfig

type AgentWgConfig struct {
	WgInterfaces string `yaml:"interfaces"` //
	EthName      string `yaml:"eth"`        //
	Forward      bool   `yaml:"forward"`    //
	Iptables     bool   `yaml:"iptables"`   //
}

func (*AgentWgConfig) GetEth

func (c *AgentWgConfig) GetEth() string

func (*AgentWgConfig) GetWgInterface

func (c *AgentWgConfig) GetWgInterface() string

func (*AgentWgConfig) GetWgInterface4Connector added in v0.0.32

func (c *AgentWgConfig) GetWgInterface4Connector() string

func (*AgentWgConfig) GetWgInterface4Pop added in v0.0.32

func (c *AgentWgConfig) GetWgInterface4Pop() string

func (*AgentWgConfig) GetWgInterfaces

func (c *AgentWgConfig) GetWgInterfaces() []string

type ApiConfig

type ApiConfig struct {
	ApiHost         string `yaml:"host"`          // API host, controller(hostname), maybe use websocket
	ApiPort         int    `yaml:"port"`          // Register port on API host, 8081
	ApiSsl          SSLCfg `yaml:"ssl"`           // ssl config of api/mtls
	ApiRegEndpoint  string `yaml:"reg_endpoint"`  // =/ws/agent
	ApiDataEndpoint string `yaml:"data_endpoint"` // =/ws/data, or other api
}

type SSLCfg

type SSLCfg struct {
	// Enable            bool   `yaml:"enable"`
	MTLS              bool   `yaml:"mtls"`
	RootCa            string `yaml:"root_ca"` // root ca pem
	ClientCertPemPath string `yaml:"client_cert_pem_path"`
	ClientCertKeyPath string `yaml:"client_cert_key_path"`
}

Jump to

Keyboard shortcuts

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