nex

package
v0.0.0-...-413ad06 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: AGPL-3.0 Imports: 10 Imported by: 5

README

Nex

The Hypernet.Nexus development SDK. Defined the useful functions and ways to handle data for both server side and client.

Parts

Nex.Cruda

Create Read Update Delete Accelerator, aka. Cruda. Cruda will help you to build a simplified database access layer based on the command system in nexus.

Nex.Sec

The security part of nexus, including signing and validating the tokens and much more.

Nex.Rx

The reactive part of nexus, such as streaming events, and message queues stuff.

Documentation

Index

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 DecodeMap

func DecodeMap(raw []byte) map[string]any

func EncodeMap

func EncodeMap(data any) []byte

func GetOutboundIP

func GetOutboundIP() (net.IP, error)

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 (v *Conn) RegisterService() error

func (*Conn) RunRegistering

func (v *Conn) RunRegistering() error

func (*Conn) ValidateCaptcha

func (v *Conn) ValidateCaptcha(token, ip string) bool

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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