summaryrefslogtreecommitdiff
path: root/pkg/db/client.go
blob: a6565059c27513ee4a42b9cd7180ab192006b04b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package db

import (
	"os"
	"path/filepath"

	"github.com/xlgmokha/x/pkg/x"
)

type Storage[T any] struct {
	dir string
}

func New[T any](dir string) *Storage[T] {
	fullPath := x.Must(filepath.Abs(dir))
	x.Check(os.MkdirAll(fullPath, 0700))

	return &Storage[T]{
		dir: fullPath,
	}
}

func (db *Storage[T]) Save(item T) error {
	return nil
}