Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BadMessageFormatError string = "bad message format"
View Source
var ErrAlreadyServing = errors.New("lsps0: already serving")
View Source
var ErrServerStopped = errors.New("lsps0: the server has been stopped")
View Source
var InternalError string = "internal error"
View Source
var Lsps0MessageType uint32 = 37913
View Source
var MaxSimultaneousRequests = 25
View Source
var PeerContextKey = ContextKey("peerId")
View Source
var TIME_FORMAT string = "2006-01-02T15:04:05.999Z"
Functions ¶
func RegisterProtocolServer ¶
func RegisterProtocolServer(s ServiceRegistrar, p ProtocolServer)
Types ¶
type ContextKey ¶
type ContextKey string
type ListProtocolsRequest ¶
type ListProtocolsRequest struct{}
type ListProtocolsResponse ¶
type ListProtocolsResponse struct {
Protocols []uint32 `json:"protocols"`
}
type MethodDesc ¶
type MethodDesc struct { MethodName string Handler methodHandler }
type ProtocolServer ¶
type ProtocolServer interface { ListProtocols( ctx context.Context, req *ListProtocolsRequest, ) (*ListProtocolsResponse, error) }
func NewProtocolServer ¶
func NewProtocolServer(supportedProtocols []uint32) ProtocolServer
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterService ¶
func (s *Server) RegisterService(desc *ServiceDesc, impl interface{})
type ServiceDesc ¶
type ServiceDesc struct { ServiceName string // The pointer to the service interface. Used to check whether the user // provided implementation satisfies the interface requirements. HandlerType interface{} Methods []MethodDesc }
type ServiceRegistrar ¶
type ServiceRegistrar interface { // RegisterService registers a service and its implementation to the // concrete type implementing this interface. It may not be called // once the server has started serving. // desc describes the service and its methods and handlers. impl is the // service implementation which is passed to the method handlers. RegisterService(desc *ServiceDesc, impl interface{}) }
ServiceRegistrar wraps a single method that supports service registration. It enables users to pass concrete types other than grpc.Server to the service registration methods exported by the IDL generated code.
Click to show internal directories.
Click to hide internal directories.