Documentation ¶
Index ¶
- type Server
- func (s *Server) DeleteSession(ctx context.Context, request *pb.RPCDeleteSessionRequest) (*pb.RPCDeleteSessionResponse, error)
- func (s *Server) GetHealth(ctx context.Context, in *pb.RPCHealthRequest) (*pb.RPCHealthReply, error)
- func (s *Server) GetPeer(ctx context.Context, request *pb.RPCGetPeerRequest) (*pb.RPCGetPeerResponse, error)
- func (s *Server) GetPeerFile(ctx context.Context, request *pb.RPCGetPeerFileRequest) (*pb.RPCGetPeerFileResponse, error)
- func (s *Server) GetPeerIds(ctx context.Context, request *pb.RPCGetPeerIdsRequest) (*pb.RPCGetPeerIdsResponse, error)
- func (s *Server) GetPublisherDefinition(context.Context, *pb.GetPublisherDefinitionRequest) (*pb.PublisherDefinition, error)
- func (s *Server) GetPublisherFile(ctx context.Context, req *pb.RPCGetPublisherFileRequest) (*pb.RPCGetPublisherFileResponse, error)
- func (s *Server) GetSession(ctx context.Context, request *pb.RPCGetSessionRequest) (*pb.RPCGetSessionResponse, error)
- func (s *Server) GetSessionIdsByDetails(ctx context.Context, request *pb.RPCGetSessionIdsByDetailsRequest) (*pb.RPCGetSessionIdsResponse, error)
- func (s *Server) GetSessionIdsByPeerIds(ctx context.Context, req *pb.RPCGetSessionIdsByPeerIdsRequest) (*pb.RPCGetSessionIdsResponse, error)
- func (s *Server) PublishPublisherUpdate(ctx context.Context, req *pb.RPCPublishPublisherUpdateRequest) (*pb.RPCPublishPublisherUpdateResponse, error)
- func (s *Server) ReadPublisherDefinition(ctx context.Context, req *pb.LoadPublisherDefinitionRequest) (*pb.Empty, error)
- func (s *Server) ReceiveDirectMessage(request *pb.RPCReceiveDirectMessageRequest, ...) error
- func (s *Server) SendDirectMessage(ctx context.Context, request *pb.RPCDirectMessage) (*pb.Empty, error)
- func (s *Server) SetNetwork(clientVersion string, networkKey string, isPrivateKey bool, ...) error
- func (s *Server) Stop()
- func (s *Server) UpsertPeer(ctx context.Context, request *pb.RPCUpsertPeerRequest) (*pb.RPCUpsertPeerResponse, error)
- func (s *Server) UpsertSession(ctx context.Context, request *pb.RPCUpsertSessionRequest) (*pb.RPCUpsertSessionResponse, error)
- func (s *Server) WritePeerFile(ctx context.Context, request *pb.RPCWritePeerFileRequest) (*pb.RPCWritePeerFileResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct { App *app.Decentralizer LastCall time.Time //Time of last call // contains filtered or unexported fields }
func (*Server) DeleteSession ¶
func (s *Server) DeleteSession(ctx context.Context, request *pb.RPCDeleteSessionRequest) (*pb.RPCDeleteSessionResponse, error)
Delete a session. Takes session id, returns bool informing if the deletion was a success
func (*Server) GetHealth ¶
func (s *Server) GetHealth(ctx context.Context, in *pb.RPCHealthRequest) (*pb.RPCHealthReply, error)
Platform
func (*Server) GetPeer ¶
func (s *Server) GetPeer(ctx context.Context, request *pb.RPCGetPeerRequest) (*pb.RPCGetPeerResponse, error)
Get an individual peer. Takes either a peer id or decentralizer id and returns the peer info.
func (*Server) GetPeerFile ¶
func (s *Server) GetPeerFile(ctx context.Context, request *pb.RPCGetPeerFileRequest) (*pb.RPCGetPeerFileResponse, error)
Get a user file. Takes a file name, returns the file.
func (*Server) GetPeerIds ¶
func (s *Server) GetPeerIds(ctx context.Context, request *pb.RPCGetPeerIdsRequest) (*pb.RPCGetPeerIdsResponse, error)
Get peer ids. takes a key and value to filter the peers by details. If left empty this filter will not apply and all will be fetched.
func (*Server) GetPublisherDefinition ¶
func (s *Server) GetPublisherDefinition(context.Context, *pb.GetPublisherDefinitionRequest) (*pb.PublisherDefinition, error)
Get the full publisher definition
func (*Server) GetPublisherFile ¶
func (s *Server) GetPublisherFile(ctx context.Context, req *pb.RPCGetPublisherFileRequest) (*pb.RPCGetPublisherFileResponse, error)
Get a publisher file.
func (*Server) GetSession ¶
func (s *Server) GetSession(ctx context.Context, request *pb.RPCGetSessionRequest) (*pb.RPCGetSessionResponse, error)
Get an individual session. Takes session id and returns session info.
func (*Server) GetSessionIdsByDetails ¶
func (s *Server) GetSessionIdsByDetails(ctx context.Context, request *pb.RPCGetSessionIdsByDetailsRequest) (*pb.RPCGetSessionIdsResponse, error)
Get session ids. Takes session type, and a key and value to filter the sessions by details. If left empty this filter will not apply and all will be fetched.
func (*Server) GetSessionIdsByPeerIds ¶
func (s *Server) GetSessionIdsByPeerIds(ctx context.Context, req *pb.RPCGetSessionIdsByPeerIdsRequest) (*pb.RPCGetSessionIdsResponse, error)
Get session ids. Takes peer ids. Returns session ids
func (*Server) PublishPublisherUpdate ¶
func (s *Server) PublishPublisherUpdate(ctx context.Context, req *pb.RPCPublishPublisherUpdateRequest) (*pb.RPCPublishPublisherUpdateResponse, error)
Publish a new publisher update. (Only if you have the private key!)
func (*Server) ReadPublisherDefinition ¶
func (s *Server) ReadPublisherDefinition(ctx context.Context, req *pb.LoadPublisherDefinitionRequest) (*pb.Empty, error)
Load a publisher definition. Will not work if its older!
func (*Server) ReceiveDirectMessage ¶
func (s *Server) ReceiveDirectMessage(request *pb.RPCReceiveDirectMessageRequest, stream pb.Decentralizer_ReceiveDirectMessageServer) error
func (*Server) SendDirectMessage ¶
func (s *Server) SendDirectMessage(ctx context.Context, request *pb.RPCDirectMessage) (*pb.Empty, error)
Messaging
Send another peer a direct message. Takes a peer id and the data it should send
func (*Server) SetNetwork ¶
func (*Server) UpsertPeer ¶
func (s *Server) UpsertPeer(ctx context.Context, request *pb.RPCUpsertPeerRequest) (*pb.RPCUpsertPeerResponse, error)
Address book
Create or update a peer. Takes peer info, returns if it was a success.
func (*Server) UpsertSession ¶
func (s *Server) UpsertSession(ctx context.Context, request *pb.RPCUpsertSessionRequest) (*pb.RPCUpsertSessionResponse, error)
Matchmaking
Create or update a session. Takes session info, returns session id.
func (*Server) WritePeerFile ¶
func (s *Server) WritePeerFile(ctx context.Context, request *pb.RPCWritePeerFileRequest) (*pb.RPCWritePeerFileResponse, error)
Storage
Write a user file. Takes a file name and the data it should save.