diff --git a/.gitignore b/.gitignore index 5e59442..7316069 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -cli/cli -backend/backend -*.json +ricochet-cli/ricochet-cli +*.ricochet diff --git a/README.md b/README.md index eee3189..f387d32 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/backend/backend.go b/backend/backend.go deleted file mode 100644 index 17dd552..0000000 --- a/backend/backend.go +++ /dev/null @@ -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) -} diff --git a/cli/client.go b/ricochet-cli/client.go similarity index 100% rename from cli/client.go rename to ricochet-cli/client.go diff --git a/cli/contact.go b/ricochet-cli/contact.go similarity index 100% rename from cli/contact.go rename to ricochet-cli/contact.go diff --git a/cli/conversation.go b/ricochet-cli/conversation.go similarity index 100% rename from cli/conversation.go rename to ricochet-cli/conversation.go diff --git a/cli/innernet.go b/ricochet-cli/innernet.go similarity index 100% rename from cli/innernet.go rename to ricochet-cli/innernet.go diff --git a/cli/cli.go b/ricochet-cli/main.go similarity index 100% rename from cli/cli.go rename to ricochet-cli/main.go diff --git a/cli/ui.go b/ricochet-cli/ui.go similarity index 100% rename from cli/ui.go rename to ricochet-cli/ui.go