net

package module
v0.0.0-...-67dccba Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 6 Imported by: 0

README

go-pantheon

go-pantheon is an out-of-the-box game server framework providing a high-performance, highly available game server cluster solution based on microservices architecture.

Core Features

  • 🚀 Microservices game server architecture built with go-kratos
  • 🔒 Multi-protocol support (TCP/KCP/WebSocket)
  • 🛡️ Enterprise-grade secure communication protocol
  • 📊 Real-time monitoring & distributed tracing
  • 🔄 Gray release & hybrid deployment support
  • 🔍 Developer-friendly debugging environment
Service Layer Features
  • gRPC for inter-service communication
  • Stateful dynamic routing & load balancing
  • Canary release & hybrid deployment support
  • Hot updates & horizontal scaling without downtime

vulcan-net

vulcan-net is a high-performance network library providing multi-protocol access, encrypted communication for gateway service go-pantheon/janus.

Features
  • Multi-protocol support (TCP/KCP/WebSocket)
  • High-efficiency connection management model
  • Connection heartbeat detection & auto-reconnect
  • ECDH + AES-GCM encrypted communication
  • Protocol Buffer API definitions

Getting Started

Contributing

We welcome contributions! Please submit any suggestions via issues or pull requests.

Documentation

Index

Constants

View Source
const (
	PackLenSize = 4
	MaxBodySize = int32(1 << 14)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Encryptor

type Encryptor interface {
	IsCrypto() bool
	Block() cipher.Block
	Key() []byte
}

type HeaderCarrier

type HeaderCarrier metadata.MD

func (HeaderCarrier) Add

func (mc HeaderCarrier) Add(key string, value string)

func (HeaderCarrier) Get

func (mc HeaderCarrier) Get(key string) string

func (HeaderCarrier) Keys

func (mc HeaderCarrier) Keys() []string

func (HeaderCarrier) Set

func (mc HeaderCarrier) Set(key string, value string)

func (HeaderCarrier) Values

func (mc HeaderCarrier) Values(key string) []string

type NetKind

type NetKind string
const (
	NetKindTCP       NetKind = "tcp"
	NetKindKCP       NetKind = "kcp"
	NetKindWebSocket NetKind = "ws"
)

type Service

type Service interface {
	Auth(ctx context.Context, in []byte) (out []byte, ss Session, err error)
	TunnelType(mod int32) (int32, error)
	CreateTunnel(ctx context.Context, ss Session, tp int32, routerId int64, worker tunnel.Worker) (tunnel.Tunnel, error)
	OnConnected(ctx context.Context, ss Session) (err error)
	OnDisconnect(ctx context.Context, ss Session) (err error)
	Handle(ctx context.Context, ss Session, h tunnel.Holder, in []byte) (err error)
}

type Session

type Session interface {
	Encryptor

	UID() int64
	SID() int64
	Color() string
	Status() int64
	StartTime() int64

	ClientIP() string
	SetClientIP(ip string)

	CSIndex() int64
	SCIndex() int64
	IncreaseCSIndex() int64
	IncreaseSCIndex() int64
}

func DefaultSession

func DefaultSession() Session

func NewSession

func NewSession(userId int64, sid int64, st int64, block cipher.Block, key []byte,
	crypto bool, color string, status int64) Session

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(endpoint string,
	operation string,
	requestHeader HeaderCarrier,
	replyHeader HeaderCarrier,
) *Transport

func (*Transport) Endpoint

func (tr *Transport) Endpoint() string

func (*Transport) Kind

func (tr *Transport) Kind() transport.Kind

func (*Transport) Operation

func (tr *Transport) Operation() string

func (*Transport) ReplyHeader

func (tr *Transport) ReplyHeader() transport.Header

func (*Transport) RequestHeader

func (tr *Transport) RequestHeader() transport.Header

Directories

Path Synopsis
middleware
dev
tcp

Jump to

Keyboard shortcuts

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