$ yum install memcached
$ yum install libmemcached
Edit config (optional):
$ vim /etc/sysconfig/memcached
| git clone -b v3.5.0 https://github.com/etcd-io/etcd.git | |
| cd etcd | |
| # Run etcd server. | |
| ./bin/etcd |
| go mod tidy | |
| go run main.go | |
| # redis is awesome |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/go-redis/redis" | |
| ) | |
| func NewRedisClient() *redis.Client { | |
| return redis.NewClient(&redis.Options{ | |
| Addr: "localhost:6379", |
| mkdir ~/my-golang-redis-app | |
| cd ~/my-golang-redis-app | |
| touch main.go | |
| go mod init github.com/romanitalian/redis_vs_etc_with_go | |
| go mod tidy | |
| tree | |
| . |
| docker pull redis | |
| docker run - name redis-test-instance -p 6379:6379 -d redis |
| #!/bin/bash | |
| # README | |
| # -------------------- | |
| # chmod u+x wasm_init.sh | |
| # ./wasm_init.sh example.com | |
| # -------------------- | |
| PROJECT_NAME="$1" | |
| if [ -z "$PROJECT_NAME" ] |
| #!/bin/bash | |
| # README | |
| # -------------------- | |
| # chmod u+x django_init.sh | |
| # ./django_init.sh my-super-project.com main | |
| # -------------------- | |
| SETTINGS_APP="core" |
https://asciinema.org/a/HBlnwgdiOytT9lmOjSGS5d9GH
To connect to memcached from the console:
$ telnet localhost 11211
And now, to exit telnet, execute: