From f5af7ffcbc96a4515e89f72639403bfc6a3ea89c Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Sun, 23 Mar 2025 23:45:38 +0100 Subject: [PATCH 1/2] fix: file cache get --- cache/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cache/file.go b/cache/file.go index 55512a1..9bd7a31 100644 --- a/cache/file.go +++ b/cache/file.go @@ -20,7 +20,7 @@ type FileCache struct { func (c *FileCache) Get(key string) (result any, err error) { path := c.getPathForItem(key) - if _, err := os.Stat(path); os.IsNotExist(err) { + if _, err := os.Stat(path + ".metadata"); os.IsNotExist(err) { return result, model.ErrCacheKeyDontExist } From abe8aec33f479469641065ffd4565e8f0139d5d9 Mon Sep 17 00:00:00 2001 From: "Felipe M." Date: Sun, 23 Mar 2025 23:45:43 +0100 Subject: [PATCH 2/2] docs: updated readme --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index 470f864..b2237e8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,25 @@ # gotoolkit +[![Go Reference](https://pkg.go.dev/badge/git.nakama.town/fmartingr/gotoolkit.svg)](https://pkg.go.dev/git.nakama.town/fmartingr/gotoolkit) + A set of basic tools to develop Go applications. +# Index + +- [Cache](#cache) +- [Database](#database) +- [Paths](#paths) +- [Service & Servers](#service--servers) +- [Template](#template) + +## Cache + +A basic cache engine to manage the cache of the application. + +```go +cache := cache.NewMemoryCache() +``` + ## Database A basic database engine to manage the connection to a database. @@ -13,6 +31,14 @@ if err != nil { } ``` +## Paths + +A basic utility to manage the paths of the application. + +```go +path := paths.ExpandUser("~/myapp") +``` + ## Service & Servers A basic way to expose servers within one service.