Documentation
¶
Index ¶
- Constants
- func DecodeMap(raw []byte) map[string]any
- func EncodeMap(data any) []byte
- func GetOutboundIP() (net.IP, error)
- type AllocatableResourceType
- type Conn
- func (v *Conn) AllocResource(t AllocatableResourceType) any
- func (v *Conn) GetClientGrpcConn(t string) (*grpc.ClientConn, error)
- func (v *Conn) GetNexusGrpcConn() *grpc.ClientConn
- func (v *Conn) RegisterService() error
- func (v *Conn) RunRegistering() error
- func (v *Conn) ValidateCaptcha(token, ip string) bool
- type WebSocketPackage
Constants ¶
View Source
const ( AllocatableResourceMq = AllocatableResourceType("mq") AllocatableResourceKv = AllocatableResourceType("kv") AllocatableResourceCache = AllocatableResourceType("cache") )
View Source
const ( ServiceTypeAuth = "id" ServiceTypePusher = "pusher" )
Variables ¶
This section is empty.
Functions ¶
func GetOutboundIP ¶
Types ¶
type AllocatableResourceType ¶
type AllocatableResourceType = string
type Conn ¶
type Conn struct {
Addr string
Info *proto.ServiceInfo
// contains filtered or unexported fields
}
func NewNexusConn ¶
func NewNexusConn(addr string, info *proto.ServiceInfo) (*Conn, error)
func (*Conn) AllocResource ¶
func (v *Conn) AllocResource(t AllocatableResourceType) any
func (*Conn) GetClientGrpcConn ¶
func (v *Conn) GetClientGrpcConn(t string) (*grpc.ClientConn, error)
func (*Conn) GetNexusGrpcConn ¶
func (v *Conn) GetNexusGrpcConn() *grpc.ClientConn
func (*Conn) RegisterService ¶
func (*Conn) RunRegistering ¶
func (*Conn) ValidateCaptcha ¶
type WebSocketPackage ¶
type WebSocketPackage struct {
Action string `json:"w"`
Endpoint string `json:"e,omitempty"`
Message string `json:"m,omitempty"`
Payload any `json:"p"`
}
func (WebSocketPackage) Marshal ¶
func (v WebSocketPackage) Marshal() []byte
func (WebSocketPackage) RawPayload ¶
func (v WebSocketPackage) RawPayload() []byte
Click to show internal directories.
Click to hide internal directories.