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: MIT
4
5package model
6
7type Server interface {
8 PluginOption(opts ...PluginOptionWith)
9 ForgeConf() (ForgeConf, error)
10 Worktree() *GrFs
11 Webcontent() *GrFs
12 Cache() *GrFs
13 // TODO delete after v0.4 is released
14 //
15 // Deprecated: Use Worktree().WriteContent(filepath, content string) instead
16 ModifyContent(filepath, content string)
17 // TODO delete after v0.4 is released
18 //
19 // Deprecated: Use Webcontent().WriteContent(filepath, content string) instead
20 ModifyWebContent(filepath, content string)
21 // TODO delete after v0.4 is released
22 //
23 // Deprecated: Use Webcontent().ReplaceContent(filepath string, oldContent string, content string) instead
24 ReplaceWebContent(filepath string, oldContent string, content string)
25 // TODO delete after v0.4 is released
26 //
27 // Deprecated: Use Cache().WriteContent(filepath, content string) instead
28 ModifyCacheContent(filepath, content string)
29 CommitAllIfNeeded(message string)
30 DiffWithParent(hash string, oldFilepath string, newFilepath string) (string, error)
31 Log(message string)
32 LogError(message string, err error)
33 Merge(from string, to string)
34 Commits(from string, to string) ([]Commit, error)
35 Exec(exec Exec) (ExecStatus, error)
36 Report(level ReportLevel, content []string) error
37 CanCallFunc(plugin string, name string, args map[string]string) bool
38 ExportFunc(name string, callback func(args map[string]string) (map[string]string, error))
39 CallFunc(plugin string, name string, args map[string]string) (map[string]string, error)
40}