mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-12-13 19:55:21 +00:00
Seperate API from UI
This commit is contained in:
21
api/client.go
Normal file
21
api/client.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/patrickmn/go-cache"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
ClientID string
|
||||
Cache *cache.Cache
|
||||
}
|
||||
|
||||
func NewClient(clientId string) (*Client) {
|
||||
client := Client{
|
||||
ClientID: clientId,
|
||||
Cache: cache.New(15*time.Minute, 15*time.Minute),
|
||||
}
|
||||
|
||||
return &client
|
||||
}
|
||||
Reference in New Issue
Block a user