Skip to content

Core Service

Implementation file: peer_service.go

Define the PeerService general entry point, verify whether the dependencies are complete, confirm that the Peer has been registered, and start Giznet services such as Admin, Public HTTP, OpenAI, RPC, etc. according to the connection request.

Core structure and main function

SymbolFunction
PeerServiceAggregate Manager, public login sessions, API handlers and domain services.
PeerService.ServeConnInitialize the Peer connection and start allowed Giznet services in parallel.
ensureConnectedPeerEnsure that the Peer resource corresponding to the connection identity exists.
validateServicesVerify required service dependencies before starting the connection.
isPeerServiceClosedDetermine whether the service loop ends due to normal connection close.