Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterWGServiceServer(s grpc.ServiceRegistrar, srv WGServiceServer)
- func StartRPC(logger *device.Logger, connection *ztn.Connection, onexit func())
- type Debugable
- type PeerReply
- func (*PeerReply) Descriptor() ([]byte, []int)deprecated
- func (x *PeerReply) GetHostname() string
- func (x *PeerReply) GetIpAddress() string
- func (x *PeerReply) GetStatus() string
- func (*PeerReply) ProtoMessage()
- func (x *PeerReply) ProtoReflect() protoreflect.Message
- func (x *PeerReply) Reset()
- func (x *PeerReply) String() string
- type PeersReply
- type PeersRequest
- type PrintDebugReply
- type PrintDebugRequest
- type StatusReply
- func (*StatusReply) Descriptor() ([]byte, []int)deprecated
- func (x *StatusReply) GetCurrentBindTechnique() string
- func (x *StatusReply) GetLastError() string
- func (x *StatusReply) GetStatus() string
- func (*StatusReply) ProtoMessage()
- func (x *StatusReply) ProtoReflect() protoreflect.Message
- func (x *StatusReply) Reset()
- func (x *StatusReply) String() string
- type StatusRequest
- type StopReply
- type StopRequest
- type UnimplementedWGServiceServer
- func (UnimplementedWGServiceServer) GetPeers(context.Context, *PeersRequest) (*PeersReply, error)
- func (UnimplementedWGServiceServer) GetStatus(context.Context, *StatusRequest) (*StatusReply, error)
- func (UnimplementedWGServiceServer) PrintDebug(context.Context, *PrintDebugRequest) (*PrintDebugReply, error)
- func (UnimplementedWGServiceServer) Stop(context.Context, *StopRequest) (*StopReply, error)
- type UnsafeWGServiceServer
- type WGServiceClient
- type WGServiceServer
- type WGServiceServerHandler
- func (s *WGServiceServerHandler) AddDebugable(d Debugable)
- func (s *WGServiceServerHandler) GetPeers(ctx context.Context, in *PeersRequest) (*PeersReply, error)
- func (s *WGServiceServerHandler) GetStatus(ctx context.Context, in *StatusRequest) (*StatusReply, error)
- func (s *WGServiceServerHandler) PrintDebug(ctx context.Context, in *PrintDebugRequest) (*PrintDebugReply, error)
- func (s *WGServiceServerHandler) SetNetworkConnection(networkConnection *ztn.NetworkConnection)
- func (s *WGServiceServerHandler) Stop(ctx context.Context, in *StopRequest) (*StopReply, error)
Constants ¶
const ServerPort = 6970
Variables ¶
var File_wgrpc_proto protoreflect.FileDescriptor
Functions ¶
func RegisterWGServiceServer ¶
func RegisterWGServiceServer(s grpc.ServiceRegistrar, srv WGServiceServer)
Types ¶
type PeerReply ¶
type PeerReply struct { IpAddress string `protobuf:"bytes,1,opt,name=ipAddress,proto3" json:"ipAddress,omitempty"` Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"` Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"` // contains filtered or unexported fields }
func (*PeerReply) Descriptor
deprecated
func (*PeerReply) GetHostname ¶
func (*PeerReply) GetIpAddress ¶
func (*PeerReply) ProtoMessage ¶
func (*PeerReply) ProtoMessage()
func (*PeerReply) ProtoReflect ¶
func (x *PeerReply) ProtoReflect() protoreflect.Message
type PeersReply ¶
type PeersReply struct { Peers []*PeerReply `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"` // contains filtered or unexported fields }
func (*PeersReply) Descriptor
deprecated
func (*PeersReply) Descriptor() ([]byte, []int)
Deprecated: Use PeersReply.ProtoReflect.Descriptor instead.
func (*PeersReply) GetPeers ¶
func (x *PeersReply) GetPeers() []*PeerReply
func (*PeersReply) ProtoMessage ¶
func (*PeersReply) ProtoMessage()
func (*PeersReply) ProtoReflect ¶
func (x *PeersReply) ProtoReflect() protoreflect.Message
func (*PeersReply) Reset ¶
func (x *PeersReply) Reset()
func (*PeersReply) String ¶
func (x *PeersReply) String() string
type PeersRequest ¶
type PeersRequest struct {
// contains filtered or unexported fields
}
func (*PeersRequest) Descriptor
deprecated
func (*PeersRequest) Descriptor() ([]byte, []int)
Deprecated: Use PeersRequest.ProtoReflect.Descriptor instead.
func (*PeersRequest) ProtoMessage ¶
func (*PeersRequest) ProtoMessage()
func (*PeersRequest) ProtoReflect ¶
func (x *PeersRequest) ProtoReflect() protoreflect.Message
func (*PeersRequest) Reset ¶
func (x *PeersRequest) Reset()
func (*PeersRequest) String ¶
func (x *PeersRequest) String() string
type PrintDebugReply ¶
type PrintDebugReply struct {
// contains filtered or unexported fields
}
func (*PrintDebugReply) Descriptor
deprecated
func (*PrintDebugReply) Descriptor() ([]byte, []int)
Deprecated: Use PrintDebugReply.ProtoReflect.Descriptor instead.
func (*PrintDebugReply) ProtoMessage ¶
func (*PrintDebugReply) ProtoMessage()
func (*PrintDebugReply) ProtoReflect ¶
func (x *PrintDebugReply) ProtoReflect() protoreflect.Message
func (*PrintDebugReply) Reset ¶
func (x *PrintDebugReply) Reset()
func (*PrintDebugReply) String ¶
func (x *PrintDebugReply) String() string
type PrintDebugRequest ¶
type PrintDebugRequest struct {
// contains filtered or unexported fields
}
func (*PrintDebugRequest) Descriptor
deprecated
func (*PrintDebugRequest) Descriptor() ([]byte, []int)
Deprecated: Use PrintDebugRequest.ProtoReflect.Descriptor instead.
func (*PrintDebugRequest) ProtoMessage ¶
func (*PrintDebugRequest) ProtoMessage()
func (*PrintDebugRequest) ProtoReflect ¶
func (x *PrintDebugRequest) ProtoReflect() protoreflect.Message
func (*PrintDebugRequest) Reset ¶
func (x *PrintDebugRequest) Reset()
func (*PrintDebugRequest) String ¶
func (x *PrintDebugRequest) String() string
type StatusReply ¶
type StatusReply struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` LastError string `protobuf:"bytes,2,opt,name=lastError,proto3" json:"lastError,omitempty"` CurrentBindTechnique string `protobuf:"bytes,3,opt,name=currentBindTechnique,proto3" json:"currentBindTechnique,omitempty"` // contains filtered or unexported fields }
func (*StatusReply) Descriptor
deprecated
func (*StatusReply) Descriptor() ([]byte, []int)
Deprecated: Use StatusReply.ProtoReflect.Descriptor instead.
func (*StatusReply) GetCurrentBindTechnique ¶
func (x *StatusReply) GetCurrentBindTechnique() string
func (*StatusReply) GetLastError ¶
func (x *StatusReply) GetLastError() string
func (*StatusReply) GetStatus ¶
func (x *StatusReply) GetStatus() string
func (*StatusReply) ProtoMessage ¶
func (*StatusReply) ProtoMessage()
func (*StatusReply) ProtoReflect ¶
func (x *StatusReply) ProtoReflect() protoreflect.Message
func (*StatusReply) Reset ¶
func (x *StatusReply) Reset()
func (*StatusReply) String ¶
func (x *StatusReply) String() string
type StatusRequest ¶
type StatusRequest struct {
// contains filtered or unexported fields
}
func (*StatusRequest) Descriptor
deprecated
func (*StatusRequest) Descriptor() ([]byte, []int)
Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead.
func (*StatusRequest) ProtoMessage ¶
func (*StatusRequest) ProtoMessage()
func (*StatusRequest) ProtoReflect ¶
func (x *StatusRequest) ProtoReflect() protoreflect.Message
func (*StatusRequest) Reset ¶
func (x *StatusRequest) Reset()
func (*StatusRequest) String ¶
func (x *StatusRequest) String() string
type StopReply ¶
type StopReply struct {
// contains filtered or unexported fields
}
func (*StopReply) Descriptor
deprecated
func (*StopReply) ProtoMessage ¶
func (*StopReply) ProtoMessage()
func (*StopReply) ProtoReflect ¶
func (x *StopReply) ProtoReflect() protoreflect.Message
type StopRequest ¶
type StopRequest struct { KillMasterProcess bool `protobuf:"varint,1,opt,name=killMasterProcess,proto3" json:"killMasterProcess,omitempty"` // contains filtered or unexported fields }
func (*StopRequest) Descriptor
deprecated
func (*StopRequest) Descriptor() ([]byte, []int)
Deprecated: Use StopRequest.ProtoReflect.Descriptor instead.
func (*StopRequest) GetKillMasterProcess ¶
func (x *StopRequest) GetKillMasterProcess() bool
func (*StopRequest) ProtoMessage ¶
func (*StopRequest) ProtoMessage()
func (*StopRequest) ProtoReflect ¶
func (x *StopRequest) ProtoReflect() protoreflect.Message
func (*StopRequest) Reset ¶
func (x *StopRequest) Reset()
func (*StopRequest) String ¶
func (x *StopRequest) String() string
type UnimplementedWGServiceServer ¶
type UnimplementedWGServiceServer struct { }
UnimplementedWGServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedWGServiceServer) GetPeers ¶
func (UnimplementedWGServiceServer) GetPeers(context.Context, *PeersRequest) (*PeersReply, error)
func (UnimplementedWGServiceServer) GetStatus ¶
func (UnimplementedWGServiceServer) GetStatus(context.Context, *StatusRequest) (*StatusReply, error)
func (UnimplementedWGServiceServer) PrintDebug ¶
func (UnimplementedWGServiceServer) PrintDebug(context.Context, *PrintDebugRequest) (*PrintDebugReply, error)
func (UnimplementedWGServiceServer) Stop ¶
func (UnimplementedWGServiceServer) Stop(context.Context, *StopRequest) (*StopReply, error)
type UnsafeWGServiceServer ¶
type UnsafeWGServiceServer interface {
// contains filtered or unexported methods
}
UnsafeWGServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to WGServiceServer will result in compilation errors.
type WGServiceClient ¶
type WGServiceClient interface { GetStatus(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusReply, error) GetPeers(ctx context.Context, in *PeersRequest, opts ...grpc.CallOption) (*PeersReply, error) Stop(ctx context.Context, in *StopRequest, opts ...grpc.CallOption) (*StopReply, error) PrintDebug(ctx context.Context, in *PrintDebugRequest, opts ...grpc.CallOption) (*PrintDebugReply, error) }
WGServiceClient is the client API for WGService 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 NewWGServiceClient ¶
func NewWGServiceClient(cc grpc.ClientConnInterface) WGServiceClient
func WGRPCClient ¶
func WGRPCClient() WGServiceClient
type WGServiceServer ¶
type WGServiceServer interface { GetStatus(context.Context, *StatusRequest) (*StatusReply, error) GetPeers(context.Context, *PeersRequest) (*PeersReply, error) Stop(context.Context, *StopRequest) (*StopReply, error) PrintDebug(context.Context, *PrintDebugRequest) (*PrintDebugReply, error) // contains filtered or unexported methods }
WGServiceServer is the server API for WGService service. All implementations must embed UnimplementedWGServiceServer for forward compatibility
type WGServiceServerHandler ¶
type WGServiceServerHandler struct { sync.Mutex UnimplementedWGServiceServer // contains filtered or unexported fields }
var WGRPCServer *WGServiceServerHandler
func NewWGServiceServerHandler ¶
func NewWGServiceServerHandler(connection *ztn.Connection, onexit func()) *WGServiceServerHandler
func (*WGServiceServerHandler) AddDebugable ¶
func (s *WGServiceServerHandler) AddDebugable(d Debugable)
func (*WGServiceServerHandler) GetPeers ¶
func (s *WGServiceServerHandler) GetPeers(ctx context.Context, in *PeersRequest) (*PeersReply, error)
func (*WGServiceServerHandler) GetStatus ¶
func (s *WGServiceServerHandler) GetStatus(ctx context.Context, in *StatusRequest) (*StatusReply, error)
func (*WGServiceServerHandler) PrintDebug ¶
func (s *WGServiceServerHandler) PrintDebug(ctx context.Context, in *PrintDebugRequest) (*PrintDebugReply, error)
func (*WGServiceServerHandler) SetNetworkConnection ¶
func (s *WGServiceServerHandler) SetNetworkConnection(networkConnection *ztn.NetworkConnection)
func (*WGServiceServerHandler) Stop ¶
func (s *WGServiceServerHandler) Stop(ctx context.Context, in *StopRequest) (*StopReply, error)