一言(Hitokoto-Go)

采用 GoLang 实现的一言(Hitokoto)程序。编译好,运行后可以直接访问使用,也可以使用 Nginx 反向代理。首次查询数据从 Mysql 读取,然后存入 Redis 缓存,之后该条数据都从 Redis 中读取了。

下载地址

Github:Hitokoto-Go

开源协议

GNU General Public License v3.0

运行环境

  • GoLang 1.9+
  • Mysql
  • Redis

Pkg

go get -u github.com/go-sql-driver/mysql
go get github.com/garyburd/redigo/redis

Mysql:

导入 ‘hitokoto.sql’ (附10条测试数据)

修改 main.go 中的 Mysql_Config

mysql_host = "127.0.0.1" 
mysql_port = "3306"      
mysql_user = "root"
mysql_pass = ""
mysql_name = "hitokoto"

Redis:

修改 main.go 中的 Redis_Config

redis_host = "127.0.0.1"
redis_port = "6379"
redis_pass = ""
redis_dbns = 0  //存储库
redis_pool = 10 //连接池最大数量

编译

cd ./src/
go build ./

运行

测试: ./hitokoto
后台运行: nohup ./hitokoto & (搭配screen更佳)

长期运行建议使用 supervisor 守护进程

大功告成

访问 127.0.0.1:8080 显示如下:

我相信十年后的八月,我们还能再相遇。

标签: Go, Hitokoto, 一言

添加新评论

已有 15 条评论

  1. Ralphdag Ralphdag

    how much is tinidazole in the philippines

  2. Essaeeykit Essaeeykit

    Running late with the deadline for your work? Then we are your reliable assistant in paper help.

    Get ready to ask for our assistance when you need essays, research or course works, reports, case studies, etc.
    Our experts have seen it all and are ready to start working on your assignment right away. Go for it!

    Get an essay or any other homework writing help

    http://bit.ly/2ykp1Qw

    buy personal narrative essay iran
    get someone write my aegis paper md
    place buy sample essay ielts
    site buy essay xo so
    don't want to write my paper aquarium
    don't want to write my cbse question paper ix
    write my english paper vellum
    writing my essay xhose
    need someone write my paper call on me video
    write my psychology my ipaper international paper fmla
    need motivation write my paper fx dream weaver
    essay service xerox copiers
    please write my paper me gmc
    pay to write my paper yfz
    need help writing my wallpaper nfl
    site buy extended essay economics
    write my how to write a persuasive paper fifth grade
    pay someone do my essay lg cell
    need someone write my paper wxix
    please write my paper e pili mau na pomaika'i me oe
    help writing my paper mm ruler
    do my homework dhr
    site buy free essay psychology
    buy cheap custom essay snr
    buy free essay kmplayer
    buy law essay yxy
    buy literary analysis essay rjd2
    get someone write my gulf newspaper qatar
    buy literary analysis essay cyber essays
    do my essay yfu
    help cant do my essay ujp
    what should i write my research paper about corruption
    need help write my paper aeroplane lyrics
    need motivation write my m8 paper nsn
    write my paper niche
    need motivation write my research paper overview
    help cant do my essay festival
    write my paper apa vybe

    http://tinyurl.com/y9wrk5dt

  3. bobo bobo

    路过发一下自己的:https://yinshi.bobo.moe/

    1. Syc Syc

      服务不可用,无法访问了Σ(゚д゚;)

      1. bobo bobo

        Σ(゚д゚;)吃鲸,并表示看了一下还活着啊 /( -◕-)\

        1. Syc Syc

          DNS解析很慢,应该是我这里的问题

    2. Syc Syc

      WoW~ Star.

  4. True True

    逛博中。。。。

    1. Syc Syc

      86年的可口可乐,来一杯吧~

      1. True True

        GoLang 1.9+ 这个环境怎么弄的?

        1. Syc Syc

          Golang环境搭建,自行Google。版本1.9.0以上即可。

  5. w4ctech w4ctech

    我相信十年后的八月,我们还能再相遇。

    1. Syc Syc

      怀着最美好的回忆,等你

  6. c0sMx c0sMx

    可以可以hhh

    1. Syc Syc

      可以试着自己搭建一个用~速度杠杆的