agent

package
v0.0.36 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 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配置信息一样,配置了通常不会变化
	Wg        *AgentWgCommonConfig `yaml:"wg"`         // common info no need to response in register, register 只是为了获取ip等动态信息(当然也可以固定),另外拿到证书不能register成功也不能直接连
}

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 AgentWgCommonConfig added in v0.0.36

type AgentWgCommonConfig struct {
	PublicKeyPath  string `json:"public_key_path"`
	PrivateKeyPath string `json:"private_key_path"`
}

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 {
	Host         string `yaml:"host"`          // API host, controller(hostname), maybe use websocket
	Port         int    `yaml:"port"`          // Register port on API host, 8081
	SSL          SSLCfg `yaml:"ssl"`           // ssl config of api/mtls
	RegEndpoint  string `yaml:"reg_endpoint"`  // =/ws/agent
	DataEndpoint string `yaml:"data_endpoint"` // =/ws/data, or other api
}

type SSLCfg

type SSLCfg struct {
	// Enable            bool   `yaml:"enable"`
	MTLS          bool   `yaml:"mtls"`
	RootCaPath    string `yaml:"root_ca_path"`    // root ca pem
	AgentCertPath string `yaml:"agent_cert_path"` // cert pem, agent could be pop/connector
	AgentKeyPath  string `yaml:"agent_key_path"`  // cert key, agent could be pop/connector
}

Jump to

Keyboard shortcuts

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