Delete backend and rename cli to ricochet-cli
ricochet-cli can act as a headless backend, so for now there is no point to having a separate backend program. It may be reintroduced later for multiprocess use by other frontends -- to be determined.
This commit is contained in:
parent
569a138e21
commit
bbc58e5815
|
@ -1,3 +1,2 @@
|
|||
cli/cli
|
||||
backend/backend
|
||||
*.json
|
||||
ricochet-cli/ricochet-cli
|
||||
*.ricochet
|
||||
|
|
|
@ -30,6 +30,4 @@ Architecture
|
|||
|
||||
**rpc** defines a [gRPC](http://www.grpc.io/) and [protobuf](https://developers.google.com/protocol-buffers/) API for communication between the client backend and frontend. This API is for trusted backends to communicate with frontend UI clients, and it's expected that both will usually be on the same machine and invisible to the end-user. Anything capable of speaking gRPC could implement a frontend.
|
||||
|
||||
**backend** is the backend application, providing the gRPC server and using the core implementation.
|
||||
|
||||
**cli** is the first frontend, a Go readline-style text-only client.
|
||||
**ricochet-cli** is a commandline program that acts as a backend and a readline-style CLI frontend. It can be used as a standalone client, to run a headless backend, or to attach to a running backend.
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
ricochet "github.com/ricochet-im/ricochet-go/core"
|
||||
rpc "github.com/ricochet-im/ricochet-go/rpc"
|
||||
"google.golang.org/grpc"
|
||||
"log"
|
||||
"net"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultListener = "127.0.0.1:58281"
|
||||
)
|
||||
|
||||
func main() {
|
||||
listener, err := net.Listen("tcp", defaultListener)
|
||||
if err != nil {
|
||||
log.Fatalf("listen failed: %v", err)
|
||||
}
|
||||
|
||||
config, err := ricochet.LoadConfig(".")
|
||||
if err != nil {
|
||||
log.Fatalf("config error: %v", err)
|
||||
}
|
||||
|
||||
core := new(ricochet.Ricochet)
|
||||
if err := core.Init(config); err != nil {
|
||||
log.Fatalf("init error: %v", err)
|
||||
}
|
||||
|
||||
server := &ricochet.RpcServer{
|
||||
Core: core,
|
||||
}
|
||||
grpcServer := grpc.NewServer()
|
||||
rpc.RegisterRicochetCoreServer(grpcServer, server)
|
||||
grpcServer.Serve(listener)
|
||||
}
|
Loading…
Reference in New Issue