control_dto

package
v0.0.10 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AGENT_CMD_REGISTER uint8 = 1
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentCmdReq

type AgentCmdReq struct {
	MsgId     string `json:"msg_id"`
	Cmd       uint8  `json:"cmd"`
	AgentType uint8  `json:"agent_type"`
	AgentId   string `json:"agent_id"`
	Ts        int64  `json:"ts"`
	Msg       string `json:"msg"`
}

type AgentCmdResp

type AgentCmdResp struct {
	MsgId string `json:"msg_id"` // echo
	Cmd   uint8  `json:"cmd"`
	Ts    int64  `json:"ts"`
	Msg   string `json:"msg"`
	Error string `json:"error,omitempty"`
}

type ConnectorRegisterReq

type ConnectorRegisterReq struct {
	ConnectorId string `json:"connector_id"`        // required, TODO: use uuid, pop_id/connector_id
	PubKey      string `json:"pub_key,omitempty"`   // [optional][pop&connector]agent's, 可以由controller 分配
	RenewKey    bool   `json:"renew_key,omitempty"` //
}

type ConnectorRegisterResp

type ConnectorRegisterResp struct {
	// pop's info
	Pop ConnectorRegisterRespPop `json:"pop"`

	// connector's info
	WgPublicKey  string `json:"wg_public_key,omitempty"`  // [optional][connector]agent's, controller 分配
	WgPrivateKey string `json:"wg_private_key,omitempty"` // [optional][connector]agent's, controller 分配
	WgPSK        string `json:"wg_psk"`                   // [optional]connector's,
	WgIP         string `json:"wg_ip"`                    // [required]connector's, controller 分配给 connector 的 wg IP

	// connector's non-wg info
	ConnectorId string `json:"connector_id"`     // [required]connector's
	Access      bool   `json:"access,omitempty"` //
	Error       string `json:"error,omitempty"`  //
}

type ConnectorRegisterRespPop added in v0.0.8

type ConnectorRegisterRespPop struct {
	PopId      string `json:"pop_id"`                // pop id
	PublicKey  string `json:"public_key"`            // pop's public_key
	WgIP       string `json:"wg_ip"`                 // pop's wg IP
	Network    string `json:"network"`               // pop's network, cidr format: 10.0.0.1/24
	Endpoint   string `json:"endpoint"`              // pop's Endpoint
	Port       int    `json:"port"`                  // pop's listen port
	AllowedIPs string `json:"allowed_ips,omitempty"` //
	DNS        string `json:"dns,omitempty"`         //
}

type PopRegisterIfaceResp

type PopRegisterIfaceResp struct {
	WgEndpoint   string `json:"endpoint"`    // required, public-ip:listen-port
	WgPort       int    `json:"port"`        // required, pop's listen-port
	WgNetwork    string `json:"network"`     // required, wg ip pool, generate by pop-controller
	WgAllowedIps string `json:"allowed_ips"` // required, generate by pop-controller
	WgDns        string `json:"dns"`         // ?
	WgIP         string `json:"wg_ip"`       // required, internal wg ip for wg client to connect, should be consist with Network

}

type PopRegisterReq

type PopRegisterReq struct {
	PopId    string `json:"pop_id"`              // required, TODO: use uuid
	PubKey   string `json:"pub_key,omitempty"`   // optional, pop's pub key, may be generate by pop-controller
	RenewKey bool   `json:"renew_key,omitempty"` //
}

type PopRegisterResp

type PopRegisterResp struct {
	PopId        string                          `json:"pop_id,omitempty"`
	WgPublicKey  string                          `json:"public_key,omitempty"`  // pop's, all the interfaces share the same key
	WgPrivateKey string                          `json:"private_key,omitempty"` // pop's
	WgInterfaces map[string]PopRegisterIfaceResp `json:"interfaces,omitempty"`  // pop's
}

type WgClientConnReq added in v0.0.8

type WgClientConnReq struct {
	ClientId string `json:"client_id"`
	PubKey   string `json:"pub_key,omitempty"`
	RenewKey bool   `json:"renew_key,omitempty"` //
}

type WgClientConnResp added in v0.0.8

type WgClientConnResp struct {
	// pop's info
	Pop WgClientConnRespPop `json:"pop"`

	// client's wg info
	WgPublicKey  string `json:"wg_public_key,omitempty"`  // [optional][client]client's, controller 分配
	WgPrivateKey string `json:"wg_private_key,omitempty"` // [optional][client]client's, controller 分配
	WgPSK        string `json:"wg_psk,omitempty"`         // [optional]client's,
	WgIP         string `json:"wg_ip"`                    // [required]client's, controller 分配给client的 wg IP

	// client's non-wg info
	ClientId string   `json:"client_id"`        // [required]client's
	Groups   []string `json:"groups,omitempty"` //
	Access   bool     `json:"access,omitempty"` //
	Error    string   `json:"error,omitempty"`  //
}

type WgClientConnRespPop added in v0.0.8

type WgClientConnRespPop struct {
	PopId      string `json:"pop_id"`                // pop id
	PublicKey  string `json:"public_key"`            // pop's public_key
	WgIP       string `json:"wg_ip"`                 // pop's wg IP
	Network    string `json:"network"`               // pop's network, cidr format: 10.0.0.1/24
	Endpoint   string `json:"endpoint"`              // pop's Endpoint
	Port       int    `json:"port"`                  // pop's listen port
	AllowedIPs string `json:"allowed_ips,omitempty"` //
	DNS        string `json:"dns,omitempty"`         //
}

Jump to

Keyboard shortcuts

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