Documentation ¶
Index ¶
- type AppManager
- type Client
- type ExternalDB
- type Machine
- type MetaConfigurator
- type P2P
- func (p2p *P2P) AddPeer(machine Machine) (*Client, error)
- func (p2p *P2P) ConfigurePeers(machines []Machine) error
- func (p2p *P2P) GetClient(name string) (*Client, error)
- func (p2p *P2P) GetGRPCServer() *grpc.Server
- func (p2p *P2P) PubKeyToPeerID(pubKey []byte) (string, error)
- func (p2p *P2P) StartServer(metaConfigurator MetaConfigurator) (func() error, error)
- type Server
- func (s *Server) ExecSQL(ctx context.Context, req *proto.ExecSQLRequest) (*proto.ExecSQLResponse, error)
- func (s *Server) GetAllCommits(context.Context, *proto.GetAllCommitsRequest) (*proto.GetAllCommitsResponse, error)
- func (s *Server) GetAppLogs(ctx context.Context, req *proto.GetAppLogsRequest) (*proto.GetAppLogsResponse, error)
- func (s *Server) GetAppStatus(ctx context.Context, req *proto.GetAppStatusRequest) (*proto.GetAppStatusResponse, error)
- func (s *Server) GetHead(context.Context, *proto.GetHeadRequest) (*proto.GetHeadResponse, error)
- func (s *Server) GetLogs(context.Context, *proto.GetLogsRequest) (*proto.GetLogsResponse, error)
- func (s *Server) GetPeers(context.Context, *proto.GetPeersRequest) (*proto.GetPeersResponse, error)
- func (s *Server) Init(ctx context.Context, req *proto.InitRequest) (*proto.InitResponse, error)
- func (s *Server) Ping(ctx context.Context, req *proto.PingRequest) (*proto.PingResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppManager ¶
type Client ¶
type Client struct { p2pproto.PingerClient p2pproto.TesterClient p2pproto.AppsClient p2pproto.InstanceClient // contains filtered or unexported fields }
Client is a remote p2p client
type ExternalDB ¶
type MetaConfigurator ¶
type MetaConfigurator interface { SetNetwork(network net.IPNet) net.IP SetInstanceName(name string) }
MetaConfigurator allows for the configuration of the meta package
type P2P ¶
type P2P struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(key *pcrypto.Key, appManager AppManager, initMode bool, externalDB ExternalDB) (*P2P, error)
NewManager creates and returns a new p2p manager
func (*P2P) ConfigurePeers ¶
ConfigurePeers configures all the peers passed as arguemnt
func (*P2P) GetGRPCServer ¶
func (*P2P) PubKeyToPeerID ¶
GetPeerID adds a peer to the p2p manager
func (*P2P) StartServer ¶
func (p2p *P2P) StartServer(metaConfigurator MetaConfigurator) (func() error, error)
StartServer starts listening for p2p connections
type Server ¶
type Server struct { DB ExternalDB // contains filtered or unexported fields }
func (*Server) ExecSQL ¶
func (s *Server) ExecSQL(ctx context.Context, req *proto.ExecSQLRequest) (*proto.ExecSQLResponse, error)
func (*Server) GetAllCommits ¶
func (s *Server) GetAllCommits(context.Context, *proto.GetAllCommitsRequest) (*proto.GetAllCommitsResponse, error)
func (*Server) GetAppLogs ¶
func (s *Server) GetAppLogs(ctx context.Context, req *proto.GetAppLogsRequest) (*proto.GetAppLogsResponse, error)
func (*Server) GetAppStatus ¶
func (s *Server) GetAppStatus(ctx context.Context, req *proto.GetAppStatusRequest) (*proto.GetAppStatusResponse, error)
func (*Server) GetHead ¶
func (s *Server) GetHead(context.Context, *proto.GetHeadRequest) (*proto.GetHeadResponse, error)
func (*Server) GetLogs ¶
func (s *Server) GetLogs(context.Context, *proto.GetLogsRequest) (*proto.GetLogsResponse, error)
HandlerGetInstanceLogs retrieves logs for the local instance
func (*Server) GetPeers ¶
func (s *Server) GetPeers(context.Context, *proto.GetPeersRequest) (*proto.GetPeersResponse, error)
HandlerGetInstancePeers retrieves the peers for the local instance
func (*Server) Init ¶
func (s *Server) Init(ctx context.Context, req *proto.InitRequest) (*proto.InitResponse, error)
HandlerInit does the initialisation on the server side
func (*Server) Ping ¶
func (s *Server) Ping(ctx context.Context, req *proto.PingRequest) (*proto.PingResponse, error)
Click to show internal directories.
Click to hide internal directories.