GitRoot

craft your forge, build your project, grow your community freely
 1// SPDX-FileCopyrightText: 2025 Romain Maneschi <romain@gitroot.dev>
 2//
 3// SPDX-License-Identifier: EUPL-1.2
 4
 5package user
 6
 7type Manager struct {
 8	rootCommiter *Commiter
 9	conf         needConf
10}
11
12type needConf interface {
13	RootCommiterPseudo() string
14	IsRootCommiter(pseudo string) bool
15	GetEmail(pseudo string) string
16	GetDirPathData() string
17	GetDirPathDataPlugin(pluginName string) string
18}
19
20func NewManager(conf needConf) (*Manager, error) {
21	commiter, err := newCommiter(conf.RootCommiterPseudo(), conf)
22	if err != nil {
23		return nil, err
24	}
25	return &Manager{
26		rootCommiter: commiter,
27		conf:         conf,
28	}, nil
29}
30
31func (m *Manager) RootCommiter() *Commiter {
32	return m.rootCommiter
33}