Documentation ¶
Index ¶
- Constants
- func GetServiceInfo(nc nrpc.NatsConn, nid string, selfnid string) (map[string][]*reflection.MethodDescriptor, error)
- func NewNatsConn(url string) (*nats.Conn, error)
- func ParseSDP(sdpstr string) ([]*ion.Stream, error)
- func RandomString(n int) string
- func Recover(flag string)
- type AtomicBool
- type ClientConnInterface
- type ServiceInterface
Constants ¶
View Source
const ( DefaultStatCycle = time.Second * 3 DefaultGRPCTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func GetServiceInfo ¶
func GetServiceInfo(nc nrpc.NatsConn, nid string, selfnid string) (map[string][]*reflection.MethodDescriptor, error)
Get service information through reflection, this feature can be used to create json-rpc, restful API
Types ¶
type AtomicBool ¶
type AtomicBool struct {
// contains filtered or unexported fields
}
AtomicBool represents a atomic bool
type ClientConnInterface ¶
type ClientConnInterface interface { grpc.ClientConnInterface Close() error }
ClientConnInterface .
func NewGRPCClientConnForNode ¶
func NewGRPCClientConnForNode(node discovery.Node) (ClientConnInterface, error)
NewGRPCClientForNode .
type ServiceInterface ¶
type ServiceInterface interface { grpc.ServiceRegistrar Serve(lis net.Listener) error Stop() }
ServiceInterface .
func NewGRPCServiceForNode ¶
func NewGRPCServiceForNode(node discovery.Node) (ServiceInterface, error)
NewGRPCServiceForNode .
Click to show internal directories.
Click to hide internal directories.