Documentation ¶
Overview ¶
Package wireguard implements wireguard GRPC behavior
Index ¶
- Variables
- func RegisterWireGuardServiceServer(s grpc.ServiceRegistrar, srv WireGuardServiceServer)
- type DumpRequest
- type DumpResponse
- type InterfaceConfig
- func (*InterfaceConfig) Descriptor() ([]byte, []int)deprecated
- func (x *InterfaceConfig) GetFirewallMark() uint32
- func (x *InterfaceConfig) GetListenPort() uint32
- func (x *InterfaceConfig) GetPeers() []*PeerConfig
- func (x *InterfaceConfig) GetPublicKey() []byte
- func (x *InterfaceConfig) GetWgIfName() string
- func (*InterfaceConfig) ProtoMessage()
- func (x *InterfaceConfig) ProtoReflect() protoreflect.Message
- func (x *InterfaceConfig) Reset()
- func (x *InterfaceConfig) String() string
- type PeerConfig
- func (*PeerConfig) Descriptor() ([]byte, []int)deprecated
- func (x *PeerConfig) GetAllowedIps() []string
- func (x *PeerConfig) GetEndpointIp() string
- func (x *PeerConfig) GetEndpontPort() uint32
- func (x *PeerConfig) GetFlags() uint32
- func (x *PeerConfig) GetLastHandshakeTime() int64
- func (x *PeerConfig) GetPersistentKeepalive() uint32
- func (x *PeerConfig) GetPresharedKey() []byte
- func (x *PeerConfig) GetPublicKey() []byte
- func (x *PeerConfig) GetReceiveBytes() int64
- func (x *PeerConfig) GetTransmitBytes() int64
- func (*PeerConfig) ProtoMessage()
- func (x *PeerConfig) ProtoReflect() protoreflect.Message
- func (x *PeerConfig) Reset()
- func (x *PeerConfig) String() string
- type UnimplementedWireGuardServiceServer
- type UnsafeWireGuardServiceServer
- type WireGuardOptions
- func (*WireGuardOptions) Descriptor() ([]byte, []int)deprecated
- func (x *WireGuardOptions) GetIntRange() *WireGuardOptions_IntRange
- func (x *WireGuardOptions) GetType() WireGuardOptions_Type
- func (*WireGuardOptions) ProtoMessage()
- func (x *WireGuardOptions) ProtoReflect() protoreflect.Message
- func (x *WireGuardOptions) Reset()
- func (x *WireGuardOptions) String() string
- type WireGuardOptions_IntRange
- func (*WireGuardOptions_IntRange) Descriptor() ([]byte, []int)deprecated
- func (x *WireGuardOptions_IntRange) GetMaximum() uint64
- func (x *WireGuardOptions_IntRange) GetMinimum() int64
- func (*WireGuardOptions_IntRange) ProtoMessage()
- func (x *WireGuardOptions_IntRange) ProtoReflect() protoreflect.Message
- func (x *WireGuardOptions_IntRange) Reset()
- func (x *WireGuardOptions_IntRange) String() string
- type WireGuardOptions_Type
- func (WireGuardOptions_Type) Descriptor() protoreflect.EnumDescriptor
- func (x WireGuardOptions_Type) Enum() *WireGuardOptions_Type
- func (WireGuardOptions_Type) EnumDescriptor() ([]byte, []int)deprecated
- func (x WireGuardOptions_Type) Number() protoreflect.EnumNumber
- func (x WireGuardOptions_Type) String() string
- func (WireGuardOptions_Type) Type() protoreflect.EnumType
- type WireGuardServiceClient
- type WireGuardServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( WireGuardOptions_Type_name = map[int32]string{ 0: "TYPE_UNSPECIFIED", 1: "TYPE_IP", 2: "TYPE_IPV4", 3: "TYPE_IPV6", 4: "TYPE_IP_WITH_MASK", 5: "TYPE_IPV4_WITH_MASK", 6: "TYPE_IPV6_WITH_MASK", 7: "TYPE_IP_OPTIONAL_MASK", 8: "TYPE_IPV4_OPTIONAL_MASK", 9: "TYPE_IPV6_OPTIONAL_MASK", } WireGuardOptions_Type_value = map[string]int32{ "TYPE_UNSPECIFIED": 0, "TYPE_IP": 1, "TYPE_IPV4": 2, "TYPE_IPV6": 3, "TYPE_IP_WITH_MASK": 4, "TYPE_IPV4_WITH_MASK": 5, "TYPE_IPV6_WITH_MASK": 6, "TYPE_IP_OPTIONAL_MASK": 7, "TYPE_IPV4_OPTIONAL_MASK": 8, "TYPE_IPV6_OPTIONAL_MASK": 9, } )
Enum value maps for WireGuardOptions_Type.
var ( // NOTE: used option field index(2000) is in extension index range of // descriptor.proto, but is not registered in protobuf global extension // registry // (https://github.com/protocolbuffers/protobuf/blob/master/docs/options.md) // // optional wireguard.v1.WireGuardOptions wireguard_options = 2000; E_WireguardOptions = &file_wireguard_v1_annotations_proto_extTypes[0] )
Extension fields to descriptorpb.FieldOptions.
var File_wireguard_v1_annotations_proto protoreflect.FileDescriptor
var File_wireguard_v1_wireguard_service_proto protoreflect.FileDescriptor
var WireGuardService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "wireguard.v1.WireGuardService", HandlerType: (*WireGuardServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _WireGuardService_Ping_Handler, }, { MethodName: "Dump", Handler: _WireGuardService_Dump_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "wireguard/v1/wireguard_service.proto", }
WireGuardService_ServiceDesc is the grpc.ServiceDesc for WireGuardService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterWireGuardServiceServer ¶
func RegisterWireGuardServiceServer(s grpc.ServiceRegistrar, srv WireGuardServiceServer)
Types ¶
type DumpRequest ¶
type DumpRequest struct { WgIfNames []string `protobuf:"bytes,1,rep,name=wg_if_names,json=wgIfNames,proto3" json:"wg_if_names,omitempty"` // contains filtered or unexported fields }
func (*DumpRequest) Descriptor
deprecated
func (*DumpRequest) Descriptor() ([]byte, []int)
Deprecated: Use DumpRequest.ProtoReflect.Descriptor instead.
func (*DumpRequest) GetWgIfNames ¶
func (x *DumpRequest) GetWgIfNames() []string
func (*DumpRequest) ProtoMessage ¶
func (*DumpRequest) ProtoMessage()
func (*DumpRequest) ProtoReflect ¶
func (x *DumpRequest) ProtoReflect() protoreflect.Message
func (*DumpRequest) Reset ¶
func (x *DumpRequest) Reset()
func (*DumpRequest) String ¶
func (x *DumpRequest) String() string
type DumpResponse ¶
type DumpResponse struct { Interfaces []*InterfaceConfig `protobuf:"bytes,1,rep,name=interfaces,proto3" json:"interfaces,omitempty"` // contains filtered or unexported fields }
func (*DumpResponse) Descriptor
deprecated
func (*DumpResponse) Descriptor() ([]byte, []int)
Deprecated: Use DumpResponse.ProtoReflect.Descriptor instead.
func (*DumpResponse) GetInterfaces ¶
func (x *DumpResponse) GetInterfaces() []*InterfaceConfig
func (*DumpResponse) ProtoMessage ¶
func (*DumpResponse) ProtoMessage()
func (*DumpResponse) ProtoReflect ¶
func (x *DumpResponse) ProtoReflect() protoreflect.Message
func (*DumpResponse) Reset ¶
func (x *DumpResponse) Reset()
func (*DumpResponse) String ¶
func (x *DumpResponse) String() string
type InterfaceConfig ¶
type InterfaceConfig struct { // The name of the wireguard interface to which this peer belongs WgIfName string `protobuf:"bytes,1,opt,name=wg_if_name,json=wgIfName,proto3" json:"wg_if_name,omitempty"` PublicKey []byte `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` ListenPort uint32 `protobuf:"varint,3,opt,name=listen_port,json=listenPort,proto3" json:"listen_port,omitempty"` FirewallMark uint32 `protobuf:"varint,4,opt,name=firewall_mark,json=firewallMark,proto3" json:"firewall_mark,omitempty"` Peers []*PeerConfig `protobuf:"bytes,5,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
Wireguard interface configuration See: https://pkg.go.dev/golang.zx2c4.com/wireguard/wgctrl/wgtypes#Config
func (*InterfaceConfig) Descriptor
deprecated
func (*InterfaceConfig) Descriptor() ([]byte, []int)
Deprecated: Use InterfaceConfig.ProtoReflect.Descriptor instead.
func (*InterfaceConfig) GetFirewallMark ¶
func (x *InterfaceConfig) GetFirewallMark() uint32
func (*InterfaceConfig) GetListenPort ¶
func (x *InterfaceConfig) GetListenPort() uint32
func (*InterfaceConfig) GetPeers ¶
func (x *InterfaceConfig) GetPeers() []*PeerConfig
func (*InterfaceConfig) GetPublicKey ¶
func (x *InterfaceConfig) GetPublicKey() []byte
func (*InterfaceConfig) GetWgIfName ¶
func (x *InterfaceConfig) GetWgIfName() string
func (*InterfaceConfig) ProtoMessage ¶
func (*InterfaceConfig) ProtoMessage()
func (*InterfaceConfig) ProtoReflect ¶
func (x *InterfaceConfig) ProtoReflect() protoreflect.Message
func (*InterfaceConfig) Reset ¶
func (x *InterfaceConfig) Reset()
func (*InterfaceConfig) String ¶
func (x *InterfaceConfig) String() string
type PeerConfig ¶
type PeerConfig struct { // Public-key base64 PublicKey []byte `protobuf:"bytes,1,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` PresharedKey []byte `protobuf:"bytes,2,opt,name=preshared_key,json=presharedKey,proto3" json:"preshared_key,omitempty"` // Peer IP EndpointIp string `protobuf:"bytes,3,opt,name=endpoint_ip,json=endpointIp,proto3" json:"endpoint_ip,omitempty"` // Peer UDP port EndpontPort uint32 `protobuf:"varint,4,opt,name=endpont_port,json=endpontPort,proto3" json:"endpont_port,omitempty"` // Keepalive interval (sec) PersistentKeepalive uint32 `protobuf:"varint,5,opt,name=persistent_keepalive,json=persistentKeepalive,proto3" json:"persistent_keepalive,omitempty"` LastHandshakeTime int64 `protobuf:"varint,6,opt,name=last_handshake_time,json=lastHandshakeTime,proto3" json:"last_handshake_time,omitempty"` ReceiveBytes int64 `protobuf:"varint,7,opt,name=receive_bytes,json=receiveBytes,proto3" json:"receive_bytes,omitempty"` TransmitBytes int64 `protobuf:"varint,8,opt,name=transmit_bytes,json=transmitBytes,proto3" json:"transmit_bytes,omitempty"` // Allowed IPs AllowedIps []string `protobuf:"bytes,9,rep,name=allowed_ips,json=allowedIps,proto3" json:"allowed_ips,omitempty"` // Flags // WIREGUARD_PEER_STATUS_DEAD = 0x1 Flags uint32 `protobuf:"varint,10,opt,name=flags,proto3" json:"flags,omitempty"` // contains filtered or unexported fields }
Wireguard peer configuration See: https://pkg.go.dev/golang.zx2c4.com/wireguard/wgctrl/wgtypes#PeerConfig
func (*PeerConfig) Descriptor
deprecated
func (*PeerConfig) Descriptor() ([]byte, []int)
Deprecated: Use PeerConfig.ProtoReflect.Descriptor instead.
func (*PeerConfig) GetAllowedIps ¶
func (x *PeerConfig) GetAllowedIps() []string
func (*PeerConfig) GetEndpointIp ¶
func (x *PeerConfig) GetEndpointIp() string
func (*PeerConfig) GetEndpontPort ¶
func (x *PeerConfig) GetEndpontPort() uint32
func (*PeerConfig) GetFlags ¶
func (x *PeerConfig) GetFlags() uint32
func (*PeerConfig) GetLastHandshakeTime ¶
func (x *PeerConfig) GetLastHandshakeTime() int64
func (*PeerConfig) GetPersistentKeepalive ¶
func (x *PeerConfig) GetPersistentKeepalive() uint32
func (*PeerConfig) GetPresharedKey ¶
func (x *PeerConfig) GetPresharedKey() []byte
func (*PeerConfig) GetPublicKey ¶
func (x *PeerConfig) GetPublicKey() []byte
func (*PeerConfig) GetReceiveBytes ¶
func (x *PeerConfig) GetReceiveBytes() int64
func (*PeerConfig) GetTransmitBytes ¶
func (x *PeerConfig) GetTransmitBytes() int64
func (*PeerConfig) ProtoMessage ¶
func (*PeerConfig) ProtoMessage()
func (*PeerConfig) ProtoReflect ¶
func (x *PeerConfig) ProtoReflect() protoreflect.Message
func (*PeerConfig) Reset ¶
func (x *PeerConfig) Reset()
func (*PeerConfig) String ¶
func (x *PeerConfig) String() string
type UnimplementedWireGuardServiceServer ¶
type UnimplementedWireGuardServiceServer struct { }
UnimplementedWireGuardServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedWireGuardServiceServer) Dump ¶
func (UnimplementedWireGuardServiceServer) Dump(context.Context, *DumpRequest) (*DumpResponse, error)
type UnsafeWireGuardServiceServer ¶
type UnsafeWireGuardServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWireGuardServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WireGuardServiceServer will result in compilation errors.
type WireGuardOptions ¶
type WireGuardOptions struct { Type WireGuardOptions_Type `protobuf:"varint,1,opt,name=type,proto3,enum=wireguard.v1.WireGuardOptions_Type" json:"type,omitempty"` IntRange *WireGuardOptions_IntRange `protobuf:"bytes,2,opt,name=int_range,json=intRange,proto3" json:"int_range,omitempty"` // contains filtered or unexported fields }
func (*WireGuardOptions) Descriptor
deprecated
func (*WireGuardOptions) Descriptor() ([]byte, []int)
Deprecated: Use WireGuardOptions.ProtoReflect.Descriptor instead.
func (*WireGuardOptions) GetIntRange ¶
func (x *WireGuardOptions) GetIntRange() *WireGuardOptions_IntRange
func (*WireGuardOptions) GetType ¶
func (x *WireGuardOptions) GetType() WireGuardOptions_Type
func (*WireGuardOptions) ProtoMessage ¶
func (*WireGuardOptions) ProtoMessage()
func (*WireGuardOptions) ProtoReflect ¶
func (x *WireGuardOptions) ProtoReflect() protoreflect.Message
func (*WireGuardOptions) Reset ¶
func (x *WireGuardOptions) Reset()
func (*WireGuardOptions) String ¶
func (x *WireGuardOptions) String() string
type WireGuardOptions_IntRange ¶
type WireGuardOptions_IntRange struct { Minimum int64 `protobuf:"varint,1,opt,name=minimum,proto3" json:"minimum,omitempty"` Maximum uint64 `protobuf:"varint,2,opt,name=maximum,proto3" json:"maximum,omitempty"` // contains filtered or unexported fields }
func (*WireGuardOptions_IntRange) Descriptor
deprecated
func (*WireGuardOptions_IntRange) Descriptor() ([]byte, []int)
Deprecated: Use WireGuardOptions_IntRange.ProtoReflect.Descriptor instead.
func (*WireGuardOptions_IntRange) GetMaximum ¶
func (x *WireGuardOptions_IntRange) GetMaximum() uint64
func (*WireGuardOptions_IntRange) GetMinimum ¶
func (x *WireGuardOptions_IntRange) GetMinimum() int64
func (*WireGuardOptions_IntRange) ProtoMessage ¶
func (*WireGuardOptions_IntRange) ProtoMessage()
func (*WireGuardOptions_IntRange) ProtoReflect ¶
func (x *WireGuardOptions_IntRange) ProtoReflect() protoreflect.Message
func (*WireGuardOptions_IntRange) Reset ¶
func (x *WireGuardOptions_IntRange) Reset()
func (*WireGuardOptions_IntRange) String ¶
func (x *WireGuardOptions_IntRange) String() string
type WireGuardOptions_Type ¶
type WireGuardOptions_Type int32
const ( WireGuardOptions_TYPE_UNSPECIFIED WireGuardOptions_Type = 0 WireGuardOptions_TYPE_IP WireGuardOptions_Type = 1 WireGuardOptions_TYPE_IPV4 WireGuardOptions_Type = 2 WireGuardOptions_TYPE_IPV6 WireGuardOptions_Type = 3 WireGuardOptions_TYPE_IP_WITH_MASK WireGuardOptions_Type = 4 WireGuardOptions_TYPE_IPV4_WITH_MASK WireGuardOptions_Type = 5 WireGuardOptions_TYPE_IPV6_WITH_MASK WireGuardOptions_Type = 6 WireGuardOptions_TYPE_IP_OPTIONAL_MASK WireGuardOptions_Type = 7 WireGuardOptions_TYPE_IPV4_OPTIONAL_MASK WireGuardOptions_Type = 8 WireGuardOptions_TYPE_IPV6_OPTIONAL_MASK WireGuardOptions_Type = 9 )
func (WireGuardOptions_Type) Descriptor ¶
func (WireGuardOptions_Type) Descriptor() protoreflect.EnumDescriptor
func (WireGuardOptions_Type) Enum ¶
func (x WireGuardOptions_Type) Enum() *WireGuardOptions_Type
func (WireGuardOptions_Type) EnumDescriptor
deprecated
func (WireGuardOptions_Type) EnumDescriptor() ([]byte, []int)
Deprecated: Use WireGuardOptions_Type.Descriptor instead.
func (WireGuardOptions_Type) Number ¶
func (x WireGuardOptions_Type) Number() protoreflect.EnumNumber
func (WireGuardOptions_Type) String ¶
func (x WireGuardOptions_Type) String() string
func (WireGuardOptions_Type) Type ¶
func (WireGuardOptions_Type) Type() protoreflect.EnumType
type WireGuardServiceClient ¶
type WireGuardServiceClient interface { Ping(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) Dump(ctx context.Context, in *DumpRequest, opts ...grpc.CallOption) (*DumpResponse, error) }
WireGuardServiceClient is the client API for WireGuardService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewWireGuardServiceClient ¶
func NewWireGuardServiceClient(cc grpc.ClientConnInterface) WireGuardServiceClient
type WireGuardServiceServer ¶
type WireGuardServiceServer interface { Ping(context.Context, *emptypb.Empty) (*emptypb.Empty, error) Dump(context.Context, *DumpRequest) (*DumpResponse, error) // contains filtered or unexported methods }
WireGuardServiceServer is the server API for WireGuardService service. All implementations must embed UnimplementedWireGuardServiceServer for forward compatibility