马哥高端Go语言百万并发 7、8期笔记
Sumpersuo
编辑于 2022年07月16日 21:52

微服务 分布式高可用 Go高并发 

记录下学习过程 底部平抡

缓存服务接口

  1. PUT /cache/<key>

  2. content

  3. <value>

  1. GET /cache/<key>

  2. content

cache包实现

本缓存服务里面通过一个cache包实现缓存功能。

  1. package cache

  2. type Cache interface {

  3. Set(string, []byte) error

  4. Get(string) ([]byte, error)

  5. Del(string) error

  6. GetStat() Stat

  7. }