This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How to use: | |
// | |
// var rpool = newPool() // can be global | |
// c := rpool.Get() | |
// defer c.Close() | |
// c.Do("GET", "my:data") | |
func newPool() *redis.Pool { | |
return &redis.Pool{ | |
MaxIdle: 10, // number of idle connections to keep for reusing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cargo add serde toml | |
pub mod config { | |
use serde::{Deserialize, Serialize}; | |
use std::{fs, path::Path}; | |
#[derive(Serialize, Deserialize)] | |
pub struct Config { | |
pub version: i8, | |
pub host: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To open SQL shell: | |
# docker exec -it yugabyte bash -c '/home/yugabyte/bin/ysqlsh -e -h $(hostname) -P null="(NULL)"' | |
services: | |
yugabyte: | |
image: yugabytedb/yugabyte:latest | |
container_name: yugabyte | |
restart: unless-stopped | |
command: bash -c 'bin/yugabyted start --advertise_address="$$(hostname -i)" --background=false' | |
# ^^^ required to prevent network binding errors if container's ip changes |