wgrpc

package
v0.0.0-...-2b8e069 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ServerPort = 6970

Variables

View Source
var File_wgrpc_proto protoreflect.FileDescriptor

Functions

func RegisterWGServiceServer

func RegisterWGServiceServer(s grpc.ServiceRegistrar, srv WGServiceServer)

func StartRPC

func StartRPC(logger *device.Logger, connection *ztn.Connection, onexit func())

Types

type Debugable

type Debugable interface {
	PrintDebug()
}

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) Descriptor() ([]byte, []int)

Deprecated: Use PeerReply.ProtoReflect.Descriptor instead.

func (*PeerReply) GetHostname

func (x *PeerReply) GetHostname() string

func (*PeerReply) GetIpAddress

func (x *PeerReply) GetIpAddress() string

func (*PeerReply) GetStatus

func (x *PeerReply) GetStatus() string

func (*PeerReply) ProtoMessage

func (*PeerReply) ProtoMessage()

func (*PeerReply) ProtoReflect

func (x *PeerReply) ProtoReflect() protoreflect.Message

func (*PeerReply) Reset

func (x *PeerReply) Reset()

func (*PeerReply) String

func (x *PeerReply) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use StopReply.ProtoReflect.Descriptor instead.

func (*StopReply) ProtoMessage

func (*StopReply) ProtoMessage()

func (*StopReply) ProtoReflect

func (x *StopReply) ProtoReflect() protoreflect.Message

func (*StopReply) Reset

func (x *StopReply) Reset()

func (*StopReply) String

func (x *StopReply) String() string

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) GetStatus

func (UnimplementedWGServiceServer) PrintDebug

func (UnimplementedWGServiceServer) Stop

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.golang.ir/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 (*WGServiceServerHandler) GetStatus

func (*WGServiceServerHandler) PrintDebug

func (*WGServiceServerHandler) SetNetworkConnection

func (s *WGServiceServerHandler) SetNetworkConnection(networkConnection *ztn.NetworkConnection)

func (*WGServiceServerHandler) Stop

Jump to

Keyboard shortcuts

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