tests

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

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

func CreateTable(t any) error

func DropTable

func DropTable(t any) error

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL