Documentation
¶
Index ¶
- Constants
- func GetSupportedSerializationTypeNames() []string
- func SerializationTypePriority(stype SerializationType) int
- func SerializationTypeToString(stype SerializationType) string
- type AddRouteParameters
- type CommandID
- type CommandName
- type CommandParameters
- type IPAddressWithCIDR
- type IncomingCommand
- type InitParameters
- type InterfaceMode
- type MessageParameters
- type OutgoingCommand
- type ReplyParameters
- type SerializationType
- type SetMTUParameters
- type VersionParameters
Constants ¶
View Source
const CommandSerializationHeaderName = "Command-Serialization"
View Source
const SupportedCommandSerializationsHeaderName = "Supported-Command-Serializations"
Variables ¶
This section is empty.
Functions ¶
func GetSupportedSerializationTypeNames ¶
func GetSupportedSerializationTypeNames() []string
func SerializationTypePriority ¶
func SerializationTypePriority(stype SerializationType) int
func SerializationTypeToString ¶
func SerializationTypeToString(stype SerializationType) string
Types ¶
type AddRouteParameters ¶
type AddRouteParameters struct {
Route IPAddressWithCIDR `json:"route"`
}
func (*AddRouteParameters) ClientCanIssue ¶
func (c *AddRouteParameters) ClientCanIssue() bool
func (*AddRouteParameters) MakeCommand ¶
func (c *AddRouteParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*AddRouteParameters) MinProtocolVersion ¶
func (c *AddRouteParameters) MinProtocolVersion() int
func (*AddRouteParameters) ServerCanIssue ¶
func (c *AddRouteParameters) ServerCanIssue() bool
type CommandName ¶
type CommandName = string
const AddRouteCommandName CommandName = "add_route"
const InitCommandName CommandName = "init"
const MessageCommandName CommandName = "message"
const ReplyCommandName CommandName = "reply"
const SetMTUCommandName CommandName = "set_mtu"
const VersionCommandName CommandName = "version"
type CommandParameters ¶
type IPAddressWithCIDR ¶
type IPAddressWithCIDR = string
type IncomingCommand ¶
type IncomingCommand struct { ID CommandID `json:"id"` Command CommandName `json:"command"` Parameters json.RawMessage `json:"parameters"` }
func DeserializeCommand ¶
func DeserializeCommand(message []byte, serializationType SerializationType) (*IncomingCommand, error)
func (*IncomingCommand) DeserializeParameters ¶
func (c *IncomingCommand) DeserializeParameters(parameters CommandParameters) error
type InitParameters ¶
type InitParameters struct { Mode InterfaceMode `json:"mode"` DoIPConfig bool `json:"do_ip_config"` IPAddress IPAddressWithCIDR `json:"ip_address"` MTU int `json:"mtu"` ServerID string `json:"server_id"` ClientID string `json:"client_id"` EnableFragmentation bool `json:"enable_fragmentation"` }
func (*InitParameters) ClientCanIssue ¶
func (c *InitParameters) ClientCanIssue() bool
func (*InitParameters) MakeCommand ¶
func (c *InitParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*InitParameters) MinProtocolVersion ¶
func (c *InitParameters) MinProtocolVersion() int
func (*InitParameters) ServerCanIssue ¶
func (c *InitParameters) ServerCanIssue() bool
type InterfaceMode ¶
type InterfaceMode = string
type MessageParameters ¶
func (*MessageParameters) ClientCanIssue ¶
func (c *MessageParameters) ClientCanIssue() bool
func (*MessageParameters) MakeCommand ¶
func (c *MessageParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*MessageParameters) MinProtocolVersion ¶
func (c *MessageParameters) MinProtocolVersion() int
func (*MessageParameters) ServerCanIssue ¶
func (c *MessageParameters) ServerCanIssue() bool
type OutgoingCommand ¶
type OutgoingCommand struct { ID CommandID `json:"id"` Command CommandName `json:"command"` Parameters CommandParameters `json:"parameters"` }
func (*OutgoingCommand) Serialize ¶
func (c *OutgoingCommand) Serialize(serializationType SerializationType) ([]byte, error)
type ReplyParameters ¶
func (*ReplyParameters) ClientCanIssue ¶
func (c *ReplyParameters) ClientCanIssue() bool
func (*ReplyParameters) MakeCommand ¶
func (c *ReplyParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*ReplyParameters) MinProtocolVersion ¶
func (c *ReplyParameters) MinProtocolVersion() int
func (*ReplyParameters) ServerCanIssue ¶
func (c *ReplyParameters) ServerCanIssue() bool
type SerializationType ¶
type SerializationType = int
const ( SerializationTypeInvalid SerializationType = iota SerializationTypeJSON )
func GetSupportedSerializationTypes ¶
func GetSupportedSerializationTypes() []SerializationType
func SerializationTypeFromString ¶
func SerializationTypeFromString(name string) SerializationType
type SetMTUParameters ¶
type SetMTUParameters struct {
MTU int `json:"mtu"`
}
func (*SetMTUParameters) ClientCanIssue ¶
func (c *SetMTUParameters) ClientCanIssue() bool
func (*SetMTUParameters) MakeCommand ¶
func (c *SetMTUParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*SetMTUParameters) MinProtocolVersion ¶
func (c *SetMTUParameters) MinProtocolVersion() int
func (*SetMTUParameters) ServerCanIssue ¶
func (c *SetMTUParameters) ServerCanIssue() bool
type VersionParameters ¶
type VersionParameters struct { ProtocolVersion int `json:"protocol_version"` Version string `json:"version"` EnabledFeatures []features.Feature `json:"enabled_features"` }
func (*VersionParameters) ClientCanIssue ¶
func (c *VersionParameters) ClientCanIssue() bool
func (*VersionParameters) MakeCommand ¶
func (c *VersionParameters) MakeCommand(id string) (*OutgoingCommand, error)
func (*VersionParameters) MinProtocolVersion ¶
func (c *VersionParameters) MinProtocolVersion() int
func (*VersionParameters) ServerCanIssue ¶
func (c *VersionParameters) ServerCanIssue() bool
Click to show internal directories.
Click to hide internal directories.