Compare commits

..

2 commits

Author SHA1 Message Date
abe8aec33f
docs: updated readme 2025-03-23 23:45:43 +01:00
f5af7ffcbc
fix: file cache get 2025-03-23 23:45:38 +01:00
2 changed files with 27 additions and 1 deletions

View file

@ -1,7 +1,25 @@
# gotoolkit # 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. 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 ## Database
A basic database engine to manage the connection to a 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 ## Service & Servers
A basic way to expose servers within one service. A basic way to expose servers within one service.

2
cache/file.go vendored
View file

@ -20,7 +20,7 @@ type FileCache struct {
func (c *FileCache) Get(key string) (result any, err error) { func (c *FileCache) Get(key string) (result any, err error) {
path := c.getPathForItem(key) 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 return result, model.ErrCacheKeyDontExist
} }