im

module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT

README

goim v2.0

goim is a im server writen by golang.

Features

  • Light weight
  • High performance
  • Pure Golang
  • Supports single push, multiple push and broadcasting
  • Supports one key to multiple subscribers (Configurable maximum subscribers count)
  • Supports heartbeats (Application heartbeats, TCP, KeepAlive, HTTP long pulling)
  • Supports authentication (Unauthenticated user can't subscribe)
  • Supports multiple protocols (WebSocket,TCP,HTTP)
  • Scalable architecture (Unlimited dynamic comet and logic modules)
  • Asynchronous push notification based on Kafka

Architecture

arch

Quick Start

Dependencies
  • kakfa: 消息队列
  • redis: 保存客户端连接信息
  • etcd: 提供服务注册/发现, comet、logic 服务注册在 etcd

docker 快速启动相关依赖:

 docker-compose -f benchmarks/kafka-docker-compose.yml up -d
 docker run -d -p 6379:6379 redis
 docker run -d -p 2379:2379 -p 2380:2380 --name etcd-v3.4.13 quay.io/coreos/etcd:v3.4.13 /usr/local/bin/etcd \ 
  --name s1 \
  --data-dir /etcd-data \
  --listen-client-urls http://0.0.0.0:2379 \
  --advertise-client-urls http://0.0.0.0:2379 \
  --listen-peer-urls http://0.0.0.0:2380 \
  --initial-advertise-peer-urls http://0.0.0.0:2380 \
  --initial-cluster s1=http://0.0.0.0:2380 \
  --initial-cluster-token tkn \
  --initial-cluster-state new \
  --log-level info \
  --logger zap \
  --log-outputs stderr
Build
    make build
Run
    make run
    make stop

    // or
    nohup target/logic -conf=target/logic.toml -logtostderr 2>&1 > target/logic.log &
    nohup target/comet -conf=target/comet.toml -logtostderr 2>&1 > target/comet.log &
Configuration

You can view the comments in target/comet.toml, target/logic.toml to understand the meaning of the config.

Document

Protocol

Directories

Path Synopsis
api
benchmarks
client_tcp command
client_ws command
cmd command
Package clock is a low consumption, low latency support for frequent updates of large capacity timing manager: 1、能够添加一次性、重复性任务,并能在其执行前撤销或频繁更改。
Package clock is a low consumption, low latency support for frequent updates of large capacity timing manager: 1、能够添加一次性、重复性任务,并能在其执行前撤销或频繁更改。
cmd command
cmd/client command
pkg/rbtree
Package rbtree implements operations on Red-Black tree.
Package rbtree implements operations on Red-Black tree.
cmd command
dao

Jump to

Keyboard shortcuts

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