From e4b4bf33ab7775b4d33f87e360c34b8fc906680e Mon Sep 17 00:00:00 2001 From: Peng Gao Date: Mon, 14 Nov 2016 11:53:45 +0800 Subject: [PATCH] Update README.md Signed-off-by: Peng Gao --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ba28064..575b54c 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,10 @@ cache can be saved to and loaded from a file (using `c.Items()` to retrieve the items map to serialize, and `NewFrom()` to create a cache from a deserialized one) to recover from downtime quickly. (See the docs for `NewFrom()` for caveats.) +### Notice + +This is a repo in development, so I leave a implementation with suffix "\_tpl" in `*.go` and the real generator main package in `cachemap` directory,to generate a template for generic usage in main package, you can try to run script like `cat cache.go | sed 's/ValueType_tpl/{{.ValueType}}/g' | sed 's/New_tpl/New{{.ValueType}}Cache/g' | sed 's/Attr_tpl/{{.ValueType}}CacheAttr/g' | sed 's/Item_tpl/{{.ValueType}}Item/g' |sed 's/Cache_tpl/{{.ValueType}}Cache/g'|sed 's/cache_tpl/{{.ValueType}}cache/g' | sed 's/package\ cache/package\ {{.PackageName}} /g' | sed 's|// MARK_Numberic_tpl_begin|{{ if call .IsNumberic .RealType }}|g' | sed 's|// MARK_Numberic_tpl_end|{{end}}|g' > cachemap/cache.tmpl` to replace "\_tpl" suffix with golang template variables in the main package. + ### Installation `go get github.com/ggaaooppeenngg/cachemap`