Documentation
¶
Index ¶
Constants ¶
View Source
const DSN = "root:test123@tcp(127.0.0.1:3306)/turl?charset=utf8mb4&parseTime=True&loc=Local"
DSN is the data source name of the MySQL database
Variables ¶
View Source
var GlobalConfig = &configs.ServerConfig{ Listen: "localhost", Port: 8080, TDDL: &configs.TDDLConfig{ Step: 100, StartNum: 10000, SeqName: "tiny_url", }, MySQL: &configs.MySQLConfig{ DSN: DSN, }, Cache: &configs.CacheConfig{ Redis: &configs.RedisConfig{ Addr: RedisAddr, DialTimeout: time.Second, }, RemoteCacheTTL: 10 * time.Minute, LocalCache: &configs.LocalCacheConfig{ TTL: 10 * time.Minute, Capacity: 1e8, MaxMemory: 512, }, }, }
View Source
var RedisAddr = []string{"127.0.0.1:6379"}
RedisAddr is the address of the redis server
Functions ¶
func CreateTable ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.