Documentation ¶
Overview ¶
Package api is a generated protocol buffer package.
It is generated from these files:
portmap.proto
It has these top-level messages:
OpenPortRequest ClosePortRequest StatusResponse
Index ¶
- Variables
- func RegisterNATserviceServer(s *grpc.Server, srv NATserviceServer)
- type ClosePortRequest
- func (*ClosePortRequest) Descriptor() ([]byte, []int)
- func (m *ClosePortRequest) GetExternalPort() int32
- func (m *ClosePortRequest) GetLocalPort() int32
- func (m *ClosePortRequest) GetTechnology() Technology
- func (*ClosePortRequest) ProtoMessage()
- func (m *ClosePortRequest) Reset()
- func (m *ClosePortRequest) String() string
- type NATserviceClient
- type NATserviceServer
- type OpenPortRequest
- func (*OpenPortRequest) Descriptor() ([]byte, []int)
- func (m *OpenPortRequest) GetExternalPort() int32
- func (m *OpenPortRequest) GetLifetime() int32
- func (m *OpenPortRequest) GetLocalPort() int32
- func (m *OpenPortRequest) GetProtocol() Protocol
- func (m *OpenPortRequest) GetTechnology() Technology
- func (*OpenPortRequest) ProtoMessage()
- func (m *OpenPortRequest) Reset()
- func (m *OpenPortRequest) String() string
- type Protocol
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)
- func (m *StatusResponse) GetMessage() string
- func (m *StatusResponse) GetSuccess() Success
- func (m *StatusResponse) GetTechnology() Technology
- func (*StatusResponse) ProtoMessage()
- func (m *StatusResponse) Reset()
- func (m *StatusResponse) String() string
- type Success
- type Technology
Constants ¶
This section is empty.
Variables ¶
View Source
var Protocol_name = map[int32]string{
0: "tcp",
1: "udp",
}
View Source
var Protocol_value = map[string]int32{
"tcp": 0,
"udp": 1,
}
View Source
var Success_name = map[int32]string{
0: "ok",
1: "notOk",
}
View Source
var Success_value = map[string]int32{
"ok": 0,
"notOk": 1,
}
View Source
var Technology_name = map[int32]string{
0: "all",
1: "natpmp",
2: "upnp",
}
View Source
var Technology_value = map[string]int32{
"all": 0,
"natpmp": 1,
"upnp": 2,
}
Functions ¶
func RegisterNATserviceServer ¶
func RegisterNATserviceServer(s *grpc.Server, srv NATserviceServer)
Types ¶
type ClosePortRequest ¶
type ClosePortRequest struct { LocalPort int32 `protobuf:"varint,1,opt,name=localPort" json:"localPort,omitempty"` ExternalPort int32 `protobuf:"varint,2,opt,name=externalPort" json:"externalPort,omitempty"` Technology Technology `protobuf:"varint,5,opt,name=technology,enum=api.Technology" json:"technology,omitempty"` }
func (*ClosePortRequest) Descriptor ¶
func (*ClosePortRequest) Descriptor() ([]byte, []int)
func (*ClosePortRequest) GetExternalPort ¶
func (m *ClosePortRequest) GetExternalPort() int32
func (*ClosePortRequest) GetLocalPort ¶
func (m *ClosePortRequest) GetLocalPort() int32
func (*ClosePortRequest) GetTechnology ¶
func (m *ClosePortRequest) GetTechnology() Technology
func (*ClosePortRequest) ProtoMessage ¶
func (*ClosePortRequest) ProtoMessage()
func (*ClosePortRequest) Reset ¶
func (m *ClosePortRequest) Reset()
func (*ClosePortRequest) String ¶
func (m *ClosePortRequest) String() string
type NATserviceClient ¶
type NATserviceClient interface { OpenPort(ctx context.Context, in *OpenPortRequest, opts ...grpc.CallOption) (*StatusResponse, error) ClosePort(ctx context.Context, in *ClosePortRequest, opts ...grpc.CallOption) (*StatusResponse, error) }
func NewNATserviceClient ¶
func NewNATserviceClient(cc *grpc.ClientConn) NATserviceClient
type NATserviceServer ¶
type NATserviceServer interface { OpenPort(context.Context, *OpenPortRequest) (*StatusResponse, error) ClosePort(context.Context, *ClosePortRequest) (*StatusResponse, error) }
type OpenPortRequest ¶
type OpenPortRequest struct { LocalPort int32 `protobuf:"varint,1,opt,name=localPort" json:"localPort,omitempty"` ExternalPort int32 `protobuf:"varint,2,opt,name=externalPort" json:"externalPort,omitempty"` Protocol Protocol `protobuf:"varint,3,opt,name=protocol,enum=api.Protocol" json:"protocol,omitempty"` Lifetime int32 `protobuf:"varint,4,opt,name=lifetime" json:"lifetime,omitempty"` Technology Technology `protobuf:"varint,5,opt,name=technology,enum=api.Technology" json:"technology,omitempty"` }
func (*OpenPortRequest) Descriptor ¶
func (*OpenPortRequest) Descriptor() ([]byte, []int)
func (*OpenPortRequest) GetExternalPort ¶
func (m *OpenPortRequest) GetExternalPort() int32
func (*OpenPortRequest) GetLifetime ¶
func (m *OpenPortRequest) GetLifetime() int32
func (*OpenPortRequest) GetLocalPort ¶
func (m *OpenPortRequest) GetLocalPort() int32
func (*OpenPortRequest) GetProtocol ¶
func (m *OpenPortRequest) GetProtocol() Protocol
func (*OpenPortRequest) GetTechnology ¶
func (m *OpenPortRequest) GetTechnology() Technology
func (*OpenPortRequest) ProtoMessage ¶
func (*OpenPortRequest) ProtoMessage()
func (*OpenPortRequest) Reset ¶
func (m *OpenPortRequest) Reset()
func (*OpenPortRequest) String ¶
func (m *OpenPortRequest) String() string
type StatusResponse ¶
type StatusResponse struct { Success Success `protobuf:"varint,1,opt,name=success,enum=api.Success" json:"success,omitempty"` Message string `protobuf:"bytes,2,opt,name=message" json:"message,omitempty"` Technology Technology `protobuf:"varint,5,opt,name=technology,enum=api.Technology" json:"technology,omitempty"` }
func (*StatusResponse) Descriptor ¶
func (*StatusResponse) Descriptor() ([]byte, []int)
func (*StatusResponse) GetMessage ¶
func (m *StatusResponse) GetMessage() string
func (*StatusResponse) GetSuccess ¶
func (m *StatusResponse) GetSuccess() Success
func (*StatusResponse) GetTechnology ¶
func (m *StatusResponse) GetTechnology() Technology
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) Reset ¶
func (m *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (m *StatusResponse) String() string
type Technology ¶
type Technology int32
const ( Technology_all Technology = 0 Technology_natpmp Technology = 1 Technology_upnp Technology = 2 )
func (Technology) EnumDescriptor ¶
func (Technology) EnumDescriptor() ([]byte, []int)
func (Technology) String ¶
func (x Technology) String() string
Click to show internal directories.
Click to hide internal directories.