feat: init api

This commit is contained in:
Ilia Denisov
2026-01-08 13:32:40 +02:00
parent 204d3df8cf
commit 972cfd82be
12 changed files with 240 additions and 108 deletions
+5 -3
View File
@@ -35,12 +35,14 @@ type Param struct {
StoragePath string
}
func NewController(configure func(*Param)) (*Controller, error) {
type Config func(*Param)
func NewController(config Config) (*Controller, error) {
c := &Param{
StoragePath: ".",
}
if configure != nil {
configure(c)
if config != nil {
config(c)
}
r, err := repo.NewFileRepo(c.StoragePath)
if err != nil {