<commit_before># swift
Swift is an easy to use, fast, distributed, supporting multi process  multi process game server framework written by Golang.  

# warning
**This framework is under development, so please don't try it at the moment.**


# how to use
````
import (
	"github.com/pengzj/swift"
	"./app/servers/connector/handler"
)

func main()  {
	app := swift.CreateApp()
	app.SetConfigPath("/Users/francis.peng/Work/PfsGame/config")
	app.SetLogPath("/Users/francis.peng/Project/logs/pfs")

	app.HandleFunc("user.login", handler.UserLogin)
	app.RegisterHandler("onChat")

	app.Run()
}

````

# server config directory
**include files**:  
|-- master.json  
|-- servers.json  
|-- cert.pem  
|-- key.pem  

master.json
```
{
  "id": "master-server-1",
  "host": "127.0.0.1",
  "port": "3015"
}
```
servers.json  
````
[
  {"type": "connector", "id": "connector-server-1","clientHost": "127.0.0.1", "clientPort": "3301", "host": "127.0.0.1", "port": "3401", "frontend": true, "connType": "tcp"},
  {"type": "connector", "id": "connector-server-2","clientHost": "127.0.0.1", "clientPort": "3302", "host": "127.0.0.1", "port": "3402", "frontend": true, "connType": "tcp"},
  {"type": "rank", "id": "rank-server-1","host": "127.0.0.1", "port": "3403", "frontend": false}
]
````


# to do list
 
db module  
db async  
optimize internal interface  
log  
manage tool
cronjob
service  
<commit_msg>modify readme<commit_after># swift
Swift is an easy to use, fast, distributed, supporting multi process  multi process game server framework written by Golang.  

# warning
**This framework is under development, so please don't try it at the moment.**


# how to use
````
import (
	"github.com/pengzj/swift"
	"./app/servers/connector/handler"
)

func main()  {
	app := swift.CreateApp()
	app.SetConfigPath("/Users/francis.peng/Work/PfsGame/config")
	app.SetLogPath("/Users/francis.peng/Project/logs/pfs")

	app.HandleFunc("user.login", handler.UserLogin)
	app.RegisterHandler("onChat")

	app.Run()
}

````

# server config directory
**include files**:  
|-- master.json  
|-- servers.json  
|-- cert.pem  
|-- key.pem  

master.json
```
{
  "id": "master-server-1",
  "host": "127.0.0.1",
  "port": "3015"
}
```
servers.json  
````
[
  {"type": "connector", "id": "connector-server-1","clientHost": "127.0.0.1", "clientPort": "3301", "host": "127.0.0.1", "port": "3401", "frontend": true, "connType": "tcp"},
  {"type": "connector", "id": "connector-server-2","clientHost": "127.0.0.1", "clientPort": "3302", "host": "127.0.0.1", "port": "3402", "frontend": true, "connType": "tcp"},
  {"type": "rank", "id": "rank-server-1","host": "127.0.0.1", "port": "3403", "frontend": false}
]
````


# to do list
 
data  async  to db
optimize internal interface  
log  
manage tool  
cronjob  
service    
test case  
benchmark 

{'fraction_non_alphanumeric': 0.21116246000710984, 'fraction_numerical': 0.04550302168503377, 'mean_word_length': 4.025, 'pattern_counts': {'":': 48, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 12, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3413149', 'n_tokens_mistral': 1131, 'n_tokens_neox': 1055, 'n_words': 248}