Documentation
¶
Overview ¶
Package gitrepo owns configured Git repositories and their HTTP surface.
Index ¶
- func RegisterGitRepositories(api huma.API, repoService *GitRepositoryService)
- type BrowseFilesInput
- type CreateGitRepositoryInput
- type DeleteGitRepositoryInput
- type GetGitRepositoryInput
- type GitRepository
- type GitRepositoryHandler
- func (h *GitRepositoryHandler) BrowseFiles(ctx context.Context, input *BrowseFilesInput) (*handlerutil.Out[gitops.BrowseResponse], error)
- func (h *GitRepositoryHandler) CreateRepository(ctx context.Context, input *CreateGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
- func (h *GitRepositoryHandler) DeleteRepository(ctx context.Context, input *DeleteGitRepositoryInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *GitRepositoryHandler) GetRepository(ctx context.Context, input *GetGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
- func (h *GitRepositoryHandler) ListBranches(ctx context.Context, input *ListBranchesInput) (*handlerutil.Out[gitops.BranchesResponse], error)
- func (h *GitRepositoryHandler) ListRepositories(ctx context.Context, input *ListGitRepositoriesInput) (*handlerutil.Page[gitops.GitRepository], error)
- func (h *GitRepositoryHandler) SyncRepositories(ctx context.Context, input *SyncGitRepositoriesInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *GitRepositoryHandler) TestRepository(ctx context.Context, input *TestGitRepositoryInput) (*handlerutil.Out[base.MessageResponse], error)
- func (h *GitRepositoryHandler) UpdateRepository(ctx context.Context, input *UpdateGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
- type GitRepositoryService
- func (s *GitRepositoryService) BrowseFiles(ctx context.Context, id, branch, path string) (*gitops.BrowseResponse, error)
- func (s *GitRepositoryService) CreateRepository(ctx context.Context, req gitops.CreateRepositoryRequest, actor user.Actor) (*GitRepository, error)
- func (s *GitRepositoryService) DeleteRepository(ctx context.Context, id string, actor user.Actor) error
- func (s *GitRepositoryService) FindEnabledRepositoryByURL(ctx context.Context, rawURL string) (*GitRepository, error)
- func (s *GitRepositoryService) GetAuthConfig(ctx context.Context, repository *GitRepository) (git.AuthConfig, error)
- func (s *GitRepositoryService) GetCommitIdentity(ctx context.Context, repository *GitRepository) (git.CommitIdentity, error)
- func (s *GitRepositoryService) GetRepositoriesPaginated(ctx context.Context, params pagination.QueryParams) ([]gitops.GitRepository, pagination.Response, error)
- func (s *GitRepositoryService) GetRepositoryByID(ctx context.Context, id string) (*GitRepository, error)
- func (s *GitRepositoryService) GetRepositoryByName(ctx context.Context, name string) (*GitRepository, error)
- func (s *GitRepositoryService) ListBranches(ctx context.Context, id string) ([]gitops.BranchInfo, error)
- func (s *GitRepositoryService) SyncRepositories(ctx context.Context, syncItems []gitops.RepositorySync) error
- func (s *GitRepositoryService) TestConnection(ctx context.Context, id, branch string, actor user.Actor) error
- func (s *GitRepositoryService) UpdateRepository(ctx context.Context, id string, req gitops.UpdateRepositoryRequest, ...) (*GitRepository, error)
- type ListBranchesInput
- type ListGitRepositoriesInput
- type Module
- type SyncGitRepositoriesInput
- type TestGitRepositoryInput
- type UpdateGitRepositoryInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterGitRepositories ¶
func RegisterGitRepositories(api huma.API, repoService *GitRepositoryService)
RegisterGitRepositories registers all git repository endpoints.
Types ¶
type BrowseFilesInput ¶
type CreateGitRepositoryInput ¶
type CreateGitRepositoryInput struct {
Body gitops.CreateRepositoryRequest
}
type DeleteGitRepositoryInput ¶
type DeleteGitRepositoryInput struct {
ID string `path:"id" doc:"Repository ID"`
}
type GetGitRepositoryInput ¶
type GetGitRepositoryInput struct {
ID string `path:"id" doc:"Repository ID"`
}
type GitRepository ¶ added in v2.8.1
type GitRepository struct {
database.BaseModel
Name string `json:"name" sortable:"true" search:"git,repository,repo,source,version,control,github,gitlab,bitbucket"`
URL string `json:"url" sortable:"true" search:"url,git,clone,remote,https,ssh"`
AuthType string `json:"authType" sortable:"true" search:"auth,authentication,credentials,token,ssh,http"` // none, http, ssh
Username string `json:"username" sortable:"true" search:"username,user,login,account"`
Token string `json:"token" search:"token,password,credentials,secret,auth"` // encrypted
SSHKey string `json:"sshKey" search:"ssh,key,private,public,certificate"` // encrypted
SSHHostKeyVerification string `json:"sshHostKeyVerification" gorm:"default:accept_new"` // strict, accept_new, skip
CommitAuthorName string `json:"commitAuthorName" gorm:"column:commit_author_name"`
CommitAuthorEmail string `json:"commitAuthorEmail" gorm:"column:commit_author_email"`
SigningKey string `json:"signingKey" gorm:"column:signing_key"` // encrypted
SigningKeyPassphrase string `json:"signingKeyPassphrase" gorm:"column:signing_key_passphrase"` // encrypted
Description *string `json:"description,omitempty" sortable:"true"`
Enabled bool `json:"enabled" sortable:"true" search:"enabled,active,disabled"`
}
func (GitRepository) HasSigningKey ¶ added in v2.12.0
func (r GitRepository) HasSigningKey() bool
HasSigningKey reports whether an OpenPGP signing key is stored.
func (GitRepository) HasSshKey ¶ added in v2.11.0
func (r GitRepository) HasSshKey() bool
HasSshKey reports whether an SSH private key is stored.
func (GitRepository) HasToken ¶ added in v2.11.0
func (r GitRepository) HasToken() bool
HasToken reports whether an HTTP token is stored.
func (GitRepository) TableName ¶ added in v2.8.1
func (GitRepository) TableName() string
type GitRepositoryHandler ¶
type GitRepositoryHandler struct {
// contains filtered or unexported fields
}
GitRepositoryHandler handles git repository management endpoints.
func (*GitRepositoryHandler) BrowseFiles ¶
func (h *GitRepositoryHandler) BrowseFiles(ctx context.Context, input *BrowseFilesInput) (*handlerutil.Out[gitops.BrowseResponse], error)
BrowseFiles returns files and directories from a git repository.
func (*GitRepositoryHandler) CreateRepository ¶
func (h *GitRepositoryHandler) CreateRepository(ctx context.Context, input *CreateGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
CreateRepository creates a new git repository.
func (*GitRepositoryHandler) DeleteRepository ¶
func (h *GitRepositoryHandler) DeleteRepository(ctx context.Context, input *DeleteGitRepositoryInput) (*handlerutil.Out[base.MessageResponse], error)
DeleteRepository deletes a git repository by ID.
func (*GitRepositoryHandler) GetRepository ¶
func (h *GitRepositoryHandler) GetRepository(ctx context.Context, input *GetGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
GetRepository returns a git repository by ID.
func (*GitRepositoryHandler) ListBranches ¶
func (h *GitRepositoryHandler) ListBranches(ctx context.Context, input *ListBranchesInput) (*handlerutil.Out[gitops.BranchesResponse], error)
ListBranches returns all branches from a git repository.
func (*GitRepositoryHandler) ListRepositories ¶
func (h *GitRepositoryHandler) ListRepositories(ctx context.Context, input *ListGitRepositoriesInput) (*handlerutil.Page[gitops.GitRepository], error)
ListRepositories returns a paginated list of git repositories.
func (*GitRepositoryHandler) SyncRepositories ¶
func (h *GitRepositoryHandler) SyncRepositories(ctx context.Context, input *SyncGitRepositoriesInput) (*handlerutil.Out[base.MessageResponse], error)
SyncRepositories syncs git repositories from a manager to this agent instance.
func (*GitRepositoryHandler) TestRepository ¶
func (h *GitRepositoryHandler) TestRepository(ctx context.Context, input *TestGitRepositoryInput) (*handlerutil.Out[base.MessageResponse], error)
TestRepository tests connectivity and authentication to a git repository.
func (*GitRepositoryHandler) UpdateRepository ¶
func (h *GitRepositoryHandler) UpdateRepository(ctx context.Context, input *UpdateGitRepositoryInput) (*handlerutil.Out[gitops.GitRepository], error)
UpdateRepository updates an existing git repository.
type GitRepositoryService ¶
type GitRepositoryService struct {
*git.Client
// contains filtered or unexported fields
}
func NewGitRepositoryService ¶
func NewGitRepositoryService(db *database.DB, workDir string, eventService *event.EventService, settingsService *settings.SettingsService) *GitRepositoryService
func (*GitRepositoryService) BrowseFiles ¶
func (s *GitRepositoryService) BrowseFiles(ctx context.Context, id, branch, path string) (*gitops.BrowseResponse, error)
func (*GitRepositoryService) CreateRepository ¶
func (s *GitRepositoryService) CreateRepository(ctx context.Context, req gitops.CreateRepositoryRequest, actor user.Actor) (*GitRepository, error)
func (*GitRepositoryService) DeleteRepository ¶
func (*GitRepositoryService) FindEnabledRepositoryByURL ¶
func (s *GitRepositoryService) FindEnabledRepositoryByURL(ctx context.Context, rawURL string) (*GitRepository, error)
func (*GitRepositoryService) GetAuthConfig ¶
func (s *GitRepositoryService) GetAuthConfig(ctx context.Context, repository *GitRepository) (git.AuthConfig, error)
func (*GitRepositoryService) GetCommitIdentity ¶ added in v2.12.0
func (s *GitRepositoryService) GetCommitIdentity(ctx context.Context, repository *GitRepository) (git.CommitIdentity, error)
GetCommitIdentity returns the author for commits Arcane pushes to the repository, with the signing key unlocked when one is stored.
func (*GitRepositoryService) GetRepositoriesPaginated ¶
func (s *GitRepositoryService) GetRepositoriesPaginated(ctx context.Context, params pagination.QueryParams) ([]gitops.GitRepository, pagination.Response, error)
func (*GitRepositoryService) GetRepositoryByID ¶
func (s *GitRepositoryService) GetRepositoryByID(ctx context.Context, id string) (*GitRepository, error)
func (*GitRepositoryService) GetRepositoryByName ¶
func (s *GitRepositoryService) GetRepositoryByName(ctx context.Context, name string) (*GitRepository, error)
func (*GitRepositoryService) ListBranches ¶
func (s *GitRepositoryService) ListBranches(ctx context.Context, id string) ([]gitops.BranchInfo, error)
func (*GitRepositoryService) SyncRepositories ¶
func (s *GitRepositoryService) SyncRepositories(ctx context.Context, syncItems []gitops.RepositorySync) error
SyncRepositories syncs repositories from a manager to this agent instance. It creates, updates, or deletes repositories to match the provided list.
func (*GitRepositoryService) TestConnection ¶
func (*GitRepositoryService) UpdateRepository ¶
func (s *GitRepositoryService) UpdateRepository(ctx context.Context, id string, req gitops.UpdateRepositoryRequest, actor user.Actor) (*GitRepository, error)
type ListBranchesInput ¶
type ListBranchesInput struct {
ID string `path:"id" doc:"Repository ID"`
}
type ListGitRepositoriesInput ¶
type ListGitRepositoriesInput struct {
Search string `query:"search" doc:"Search query"`
Sort string `query:"sort" doc:"Column to sort by"`
Order string `query:"order" default:"asc" doc:"Sort direction"`
Start int `query:"start" default:"0" doc:"Start index"`
Limit int `query:"limit" default:"20" doc:"Items per page"`
}
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func New ¶
func New(service *GitRepositoryService) *Module
func (*Module) RegisterRoutes ¶
func (*Module) Service ¶
func (m *Module) Service() *GitRepositoryService
type SyncGitRepositoriesInput ¶
type SyncGitRepositoriesInput struct {
Body gitops.RepositorySyncRequest
}
type TestGitRepositoryInput ¶
type UpdateGitRepositoryInput ¶
type UpdateGitRepositoryInput struct {
ID string `path:"id" doc:"Repository ID"`
Body gitops.UpdateRepositoryRequest
}