lsps0

package
v0.0.0-...-bb3e765 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 12 Imported by: 0

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 NewServer

func NewServer() *Server

func (*Server) RegisterService

func (s *Server) RegisterService(desc *ServiceDesc, impl interface{})

func (*Server) Serve

func (s *Server) Serve(lis lightning.CustomMsgClient) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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