api

package
v0.0.0-...-b598ae0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2019 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

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 New

func New(ctx context.Context, port int, profile string) (*Server, error)

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

Get the full publisher definition

func (*Server) GetPublisherFile

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

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 (*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 (s *Server) SetNetwork(clientVersion string, networkKey string, isPrivateKey bool, limitedConnection bool) error

func (*Server) Stop

func (s *Server) Stop()

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.

Jump to

Keyboard shortcuts

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