Documentation
¶
Index ¶
- func DeriveServerID(pub []byte) string
- func LoadFederationTLSConfig(certFile, keyFile, caFile string) (*tls.Config, error)
- func LoadPeers(path string) ([]types.PeerConfig, error)
- type Bootstrap
- func (b *Bootstrap) InitDb(ctx context.Context) error
- func (b *Bootstrap) InitFederation() error
- func (b *Bootstrap) InitFederationTLS() (*tls.Config, error)
- func (b *Bootstrap) InitStrikeServer(creds credentials.TransportCredentials, peers []types.PeerConfig) error
- func (b *Bootstrap) Start(ctx context.Context) error
- func (b *Bootstrap) Stop(ctx context.Context)
- type FederationOrchestrator
- type Identity
- type PeerManager
- type ServerDB
- type StrikeServer
- func (s *StrikeServer) EnqueueFederated(ctx context.Context, rp *fedpb.RelayPayload) error
- func (s *StrikeServer) Login(ctx context.Context, clientLogin *pb.LoginVerify) (*pb.ServerResponse, error)
- func (s *StrikeServer) SaltMine(ctx context.Context, userInfo *common_pb.UserInfo) (*pb.Salt, error)
- func (s *StrikeServer) SendPayload(ctx context.Context, payload *pb.StreamPayload) (*pb.ServerResponse, error)
- func (s *StrikeServer) Signup(ctx context.Context, userInit *pb.InitUser) (*pb.ServerResponse, error)
- func (s *StrikeServer) UpdateRemotePresence(user uuid.UUID, peerID string)
- func (s *StrikeServer) UserRequest(ctx context.Context, userInfo *common_pb.UserInfo) (*common_pb.UserInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveServerID ¶
func LoadFederationTLSConfig ¶
Types ¶
type Bootstrap ¶
type Bootstrap struct {
Cfg config.ServerConfig
DB *pgxpool.Pool
Statements *ServerDB
Strike *StrikeServer
Orchestrator *FederationOrchestrator
// contains filtered or unexported fields
}
func InitBootstrap ¶
func InitBootstrap(cfg config.ServerConfig) *Bootstrap
func (*Bootstrap) InitFederation ¶
func (*Bootstrap) InitStrikeServer ¶
func (b *Bootstrap) InitStrikeServer(creds credentials.TransportCredentials, peers []types.PeerConfig) error
type FederationOrchestrator ¶
type FederationOrchestrator struct {
pb.UnimplementedFederationServer
// contains filtered or unexported fields
}
func NewFederationOrchestrator ¶
func NewFederationOrchestrator(s *StrikeServer) *FederationOrchestrator
func (*FederationOrchestrator) Handshake ¶
func (fo *FederationOrchestrator) Handshake( ctx context.Context, req *pb.HandshakeReq, ) (*pb.HandshakeAck, error)
func (*FederationOrchestrator) Relay ¶
func (fo *FederationOrchestrator) Relay( ctx context.Context, rp *pb.RelayPayload, ) (*pb.RelayAck, error)
type PeerManager ¶
type PeerManager struct {
// contains filtered or unexported fields
}
func NewPeerManager ¶
func NewPeerManager(peers map[string]*types.Peer) *PeerManager
func (*PeerManager) Client ¶
func (pm *PeerManager) Client(peerID string) (fedpb.FederationClient, bool)
func (*PeerManager) ConnectAll ¶
type ServerDB ¶
type StrikeServer ¶
type StrikeServer struct {
pb.UnimplementedStrikeServer
ID uuid.UUID
Name string
PeerMgr *PeerManager
DBpool *pgxpool.Pool
PStatements *ServerDB
Pending map[uuid.UUID]*types.PendingMsg
RemotePresence map[uuid.UUID]string
// contains filtered or unexported fields
}
func (*StrikeServer) EnqueueFederated ¶
func (s *StrikeServer) EnqueueFederated(ctx context.Context, rp *fedpb.RelayPayload) error
func (*StrikeServer) Login ¶
func (s *StrikeServer) Login(ctx context.Context, clientLogin *pb.LoginVerify) (*pb.ServerResponse, error)
func (*StrikeServer) SendPayload ¶
func (s *StrikeServer) SendPayload(ctx context.Context, payload *pb.StreamPayload) (*pb.ServerResponse, error)
func (*StrikeServer) Signup ¶
func (s *StrikeServer) Signup(ctx context.Context, userInit *pb.InitUser) (*pb.ServerResponse, error)
func (*StrikeServer) UpdateRemotePresence ¶
func (s *StrikeServer) UpdateRemotePresence(user uuid.UUID, peerID string)
func (*StrikeServer) UserRequest ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.