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 ¶ added in v1.9.1
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
func RandomString ¶ added in v1.5.0
RandomString generate a random string
Types ¶
type AtomicBool ¶ added in v1.5.0
type AtomicBool struct {
// contains filtered or unexported fields
}
AtomicBool represents a atomic bool
func (*AtomicBool) Set ¶ added in v1.5.0
func (b *AtomicBool) Set(value bool) (swapped bool)
Set atomic bool
type ClientConnInterface ¶ added in v1.9.0
type ClientConnInterface interface {
grpc.ClientConnInterface
Close() error
}
ClientConnInterface .
func NewGRPCClientConnForNode ¶ added in v1.9.0
func NewGRPCClientConnForNode(node discovery.Node) (ClientConnInterface, error)
NewGRPCClientForNode .
type ServiceInterface ¶ added in v1.9.0
type ServiceInterface interface {
grpc.ServiceRegistrar
Serve(lis net.Listener) error
Stop()
}
ServiceInterface .
func NewGRPCServiceForNode ¶ added in v1.9.0
func NewGRPCServiceForNode(node discovery.Node) (ServiceInterface, error)
NewGRPCServiceForNode .
Click to show internal directories.
Click to hide internal directories.