Compare commits
	
		
			No commits in common. "abe8aec33f479469641065ffd4565e8f0139d5d9" and "597feb7b5490439350abb280aa7b8a4be5ef0848" have entirely different histories.
		
	
	
		
			abe8aec33f
			...
			597feb7b54
		
	
		
					 2 changed files with 1 additions and 27 deletions
				
			
		
							
								
								
									
										26
									
								
								README.md
									
										
									
									
									
								
							
							
						
						
									
										26
									
								
								README.md
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1,25 +1,7 @@
 | 
			
		|||
# gotoolkit
 | 
			
		||||
 | 
			
		||||
[](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.
 | 
			
		||||
| 
						 | 
				
			
			@ -31,14 +13,6 @@ 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.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										2
									
								
								cache/file.go
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								cache/file.go
									
										
									
									
										vendored
									
									
								
							| 
						 | 
				
			
			@ -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 + ".metadata"); os.IsNotExist(err) {
 | 
			
		||||
	if _, err := os.Stat(path); os.IsNotExist(err) {
 | 
			
		||||
		return result, model.ErrCacheKeyDontExist
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue