Something went wrong. Try again.
Lightweight and easily self-hostable Git forge.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657package app
import ( db "farga/db" "farga/db/types" "farga/lib"
"github.com/go-git/go-git/v6" "github.com/google/uuid")
type Store interface { NewSession(userID *uuid.UUID) (types.Session, error) DeleteSession(sessionID string) error Session(token uuid.UUID) (types.Session, error)
NewUser(user *types.User) error NewUserWithInvite(user *types.User, inviteToken string) error LoginUser(email, password string) (*types.User, error) User(id uuid.UUID) (*types.User, error) UserHandle(handle string) (*types.User, error) UserRepos(userID *uuid.UUID) ([]types.Repo, error) SaveHackatimeToken(userID uuid.UUID, token string) error UpdateUserConfig(userId uuid.UUID, config types.UserConfig) error
NewInvite(o db.NewInviteOptions) (types.Invite, error) ValidateInviteToken(token string) (types.Invite, bool) DeleteInviteToken(token string) error DeleteExpiredInviteTokens()
NewRepo(user types.User, repo types.Repo) (*git.Repository, error) SetRepoHackatimeName(repoID uuid.UUID, name string) error SetRepoVisibility(repoID uuid.UUID, public bool) error RepoHandle(userHandle, repoName string) (types.Repo, error) DeleteRepo(userID uuid.UUID) error SetRepoIssueConfig(repoID uuid.UUID, allowAnonymousIssues bool, allowNewIssues bool) error
NewIssue(issue *types.Issue) error CloseIssue(issue *types.Issue) error Issue(repo *types.Repo, issueNumber uint) (types.Issue, error) IssueComments(issueID uuid.UUID) ([]types.IssueComment, error) NewIssueComment(comment *types.IssueComment) error
NewGist(userID uuid.UUID, title string, content string) (types.Gist, error) GetGist(id uuid.UUID) (gist types.Gist, err error) DeleteGist(id uuid.UUID) error UpdateGist(id uuid.UUID, title string, content string) (types.Gist, error)
NewPubKey(name string, pubKey lib.SSHPubKey, userID uuid.UUID) (types.SSHPubKey, error) DeletePubKey(keyID uuid.UUID, userID uuid.UUID) error
CreateOAuthState(id uuid.UUID) (*types.OAuthState, error) OAuthState(token string) (types.OAuthState, error) DeleteOAuthState(id uuid.UUID) error DeleteExpiredOAuthStates()}