ribice / goch Goto Github PK
View Code? Open in Web Editor NEWSelf hosted live chat server written in Go
Home Page: https://www.ribice.ba/goch
License: MIT License
Self hosted live chat server written in Go
Home Page: https://www.ribice.ba/goch
License: MIT License
Document every endpoint in Readme
The architecture of the project was good, except that I didn't run it properly, and there were a lot of bugs.Still hope the author can add a test example
The static client for gossip (pre-fork version) is available here.
The endpoints are different now (most changed from POST
to GET
and from JSON body to URL/Query params).
Other than that it should be straightforward.
The React chat component should be able to hook without changes to the modified client.
I'm just getting started with Golang. This looks great.
Just wondering if you could point into the right direction. I can't reach this on the localhost:8080
Issue below with go command not found, is it referring to the line 2 in the up file? Appreciate the time.
./up: 2: ./up: go: not found
GOOS=linux CGO_ENABLED=0 go build -o goch .
sudo ./up ./up: 2: ./up: go: not found Starting goch... Building goch Step 1/4 : FROM yikaus/alpine-bash ---> c98c656004a8 Step 2/4 : RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* ---> Using cache ---> 1d178928b654 Step 3/4 : ADD goch / ---> Using cache ---> 59f910a90085 Step 4/4 : ENTRYPOINT /goch ---> Using cache ---> 9d683bad10c7 Successfully built 9d683bad10c7 Successfully tagged goch_goch:latest Starting goch_nats_stream_1 ... done Starting goch_redis_1 ... done Starting goch_goch_1 ... done Attaching to goch_redis_1, goch_nats_stream_1, goch_goch_1 redis_1 | 1:C 27 May 2020 04:50:36.126 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis_1 | 1:C 27 May 2020 04:50:36.126 # Redis version=6.0.3, bits=64, commit=00000000, modified=0, pid=1, just started nats_stream_1 | [1] 2020/05/27 04:50:36.194234 [INF] STREAM: Starting nats-streaming-server[test-cluster] version 0.17.0 nats_stream_1 | [1] 2020/05/27 04:50:36.194270 [INF] STREAM: ServerID: nGTtYw76Q6tSdgCXY6WexD nats_stream_1 | [1] 2020/05/27 04:50:36.194276 [INF] STREAM: Go version: go1.13.7 nats_stream_1 | [1] 2020/05/27 04:50:36.194281 [INF] STREAM: Git commit: [f4b7190] nats_stream_1 | [1] 2020/05/27 04:50:36.195443 [INF] Starting nats-server version 2.1.4 nats_stream_1 | [1] 2020/05/27 04:50:36.195461 [INF] Git commit [fb009af] nats_stream_1 | [1] 2020/05/27 04:50:36.195846 [INF] Starting http monitor on 0.0.0.0:8222 nats_stream_1 | [1] 2020/05/27 04:50:36.195925 [INF] Listening for client connections on 0.0.0.0:4222 nats_stream_1 | [1] 2020/05/27 04:50:36.195931 [INF] Server id is NCXIXTJAGO6NTMRMBNHX37YKLQWM4LRPFRTYHU7R57FKTVAYUNTMEH7B nats_stream_1 | [1] 2020/05/27 04:50:36.195934 [INF] Server is ready redis_1 | 1:C 27 May 2020 04:50:36.126 # Configuration loaded nats_stream_1 | [1] 2020/05/27 04:50:36.223499 [INF] STREAM: Recovering the state... redis_1 | 1:M 27 May 2020 04:50:36.128 * Running mode=standalone, port=6379. redis_1 | 1:M 27 May 2020 04:50:36.129 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis_1 | 1:M 27 May 2020 04:50:36.129 # Server initialized nats_stream_1 | [1] 2020/05/27 04:50:36.224485 [INF] STREAM: Recovered 0 channel(s) redis_1 | 1:M 27 May 2020 04:50:36.129 * Ready to accept connections nats_stream_1 | [1] 2020/05/27 04:50:36.474956 [INF] STREAM: Message store is FILE nats_stream_1 | [1] 2020/05/27 04:50:36.474974 [INF] STREAM: Store location: data nats_stream_1 | [1] 2020/05/27 04:50:36.475007 [INF] STREAM: ---------- Store Limits ---------- nats_stream_1 | [1] 2020/05/27 04:50:36.475012 [INF] STREAM: Channels: unlimited nats_stream_1 | [1] 2020/05/27 04:50:36.475016 [INF] STREAM: --------- Channels Limits -------- nats_stream_1 | [1] 2020/05/27 04:50:36.475019 [INF] STREAM: Subscriptions: 1000 * nats_stream_1 | [1] 2020/05/27 04:50:36.475022 [INF] STREAM: Messages : 1000000 * nats_stream_1 | [1] 2020/05/27 04:50:36.475025 [INF] STREAM: Bytes : 976.56 MB * nats_stream_1 | [1] 2020/05/27 04:50:36.475029 [INF] STREAM: Age : unlimited * nats_stream_1 | [1] 2020/05/27 04:50:36.475031 [INF] STREAM: Inactivity : unlimited * nats_stream_1 | [1] 2020/05/27 04:50:36.475035 [INF] STREAM: ---------------------------------- nats_stream_1 | [1] 2020/05/27 04:50:36.475039 [INF] STREAM: Streaming Server is ready goch_1 | 2020/05/27 04:50:37 starting server on port:8080
With go mod support, you can:
/vendor
./up
without having to adjust any Go envs, since dependencies will be installed by default to users' GOPATH
To convert to go modules from Gopkg:
cd goch
go mod init
go get
Running go mod init
will create a go.mod
file.
Running go get
will generate your go.sum
file.
With those, you can safely get rid of:
/vendor
Gopkg.lock
Gopkg.toml
Currently you can have only one chat per websocket connection.
This is limited in internal/agent/agent.go
where Agent struct holds single Chat.
On client, this currently works by connecting to new chat and disconnecting from previous one each time a different chat is clicked. But this prevents getting messages from other chats, although you can still show number of unread messages by invoking the unread count endpoint.
Tried to follow your setup instructions to run locally, but I get this issue when running the docker compose command:
> docker-compose up --build
ERROR: Couldn't find env file: MY_GOPATH\src\github.com\ribice\goch\.env
I see that .env is in the .gitignore file, but referenced in the docker-compose.yml file, I am just wondering if that is the issue or if I am missing something.
Thank you for your help! Very excited to check out your project!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.