Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeRequest = "request" // Manager -> Agent TypeResult = "result" // Manager <- Agent, always tied with a request TypeEvent = "event" // Manager <- Agent, untied with a request )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigureRequestArgs ¶
type ConfigureRequestArgs struct { // Fields added in v0.2.0 Me net.IP `json:"me"` // Required Forwards []Forward `json:"forwards,omitempty"` Others []IPPortProto `json:"others,omitempty"` // Fields added in v0.4.0 HostnameMap map[string]net.IP `json:"hostnameMap,omitempty"` // hostname -> ip HTTP HTTP `json:"http,omitempty"` SOCKS SOCKS `json:"socks,omitempty"` Loopback Loopback `json:"loopback,omitempty"` StateDir StateDir `json:"stateDir,omitempty"` WriteEtcHosts bool `json:"writeEtcHosts,omitempty"` // Fields added in v0.5.0 Routes []Route `json:"routes,omitempty"` NameServers []NameServer `json:"nameServers,omitempty"` }
type ConfigureResultData ¶
type Event ¶ added in v0.5.0
type Event struct { Type EventType `json:"type"` // Required Data json.RawMessage `json:"data,omitempty"` }
type EventType ¶ added in v0.5.0
type EventType = string
const (
EventTypeRouteSuggestion EventType = "routeSuggestion"
)
type Forward ¶
type Forward struct { // listenIP is "me" ListenPort uint16 `json:"listen_port"` // ConnectIP can be either IP or hostname. // Until NoRouter v0.4.0, it had to be IP. // The field name stil contains "_ip" suffix for compatibility. ConnectIP string `json:"connect_ip"` ConnectPort uint16 `json:"connect_port"` Proto string `json:"proto"` }
Forward uses snake_case rather than camelCase by accident :(
type IPPortProto ¶
type Message ¶
type Message struct { Type Type `json:"type"` // Required Body json.RawMessage `json:"body"` // Request or Result }
type NameServer ¶ added in v0.5.0
type NameServer struct {
IPPortProto
}
NameServer represents a built-in virtual DNS
type Request ¶
type Request struct { ID int `json:"id"` // Required Op Op `json:"op"` // Required Args json.RawMessage `json:"args,omitempty"` }
type Result ¶
type Result struct { RequestID int `json:"request_id"` // Required Op Op `json:"op"` // Required Error json.RawMessage `json:"error,omitempty"` Data json.RawMessage `json:"data,omitempty"` }
type RouteSuggestionEventData ¶ added in v0.5.0
Click to show internal directories.
Click to hide internal directories.