git

package
v0.0.0-...-fdaa03f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageChainProbeModeFull          = "full"
	StorageChainProbeModeInventoryOnly = "inventory_only"

	StorageChainBucketModeItems    = "items"
	StorageChainBucketModeValidate = "validate"

	StorageChainValidationModeList      = "list"
	StorageChainValidationModeMetadata  = "metadata"
	StorageChainValidationModeInventory = "inventory"
)
View Source
const (
	GitSyncNeverSynced = "never_synced"
	GitSyncReady       = "ready"
	GitSyncUpdating    = "updating"
	GitSyncError       = "error"

	GitInstallationNotConnected = "not_connected"
	GitInstallationConnected    = "connected"

	GitWorkflowStageAwaitingGitHubConnect = "awaiting_github_connect"
	GitWorkflowStageGitHubConnected       = "github_connected"
)
View Source
const (
	GitUploadSessionPending   = "pending_upload"
	GitUploadSessionReady     = "ready_for_pr"
	GitUploadSessionFinalized = "finalized"

	GitUploadFilePending   = "pending_upload"
	GitUploadFileUploaded  = "uploaded"
	GitUploadFileCollision = "collision"
)
View Source
const StorageFolderSummaryModeExact = "exact"
View Source
const StorageFolderSummarySourceExactJoin = "exact_join"
View Source
const StorageFolderSummarySourceGitIndex = "git_index"

Variables

This section is empty.

Functions

func BuildDefaultUploadPRBody

func BuildDefaultUploadPRBody(baseBranch string, subdirectory string) string

func BuildDefaultUploadPRTitle

func BuildDefaultUploadPRTitle(project string, fileCount int) string

func BuildGitUploadBranchName

func BuildGitUploadBranchName(project string) string

func BuildGitUploadTargetPath

func BuildGitUploadTargetPath(subdirectory string, fileName string) string

func BuildLFSPointerContent

func BuildLFSPointerContent(checksum string, size int64) string

func DefaultStorageChainValidationMode

func DefaultStorageChainValidationMode(probeMode string, bucketMode string) string

func DeleteAuthzResource

func DeleteAuthzResource(ctx context.Context, authorizationHeader, resourcePath string) error

func GitPathExistsInRef

func GitPathExistsInRef(repo *gogit.Repository, hash plumbing.Hash, path string) (bool, error)

func NewProjectBucketInventoryCacheFromEnv

func NewProjectBucketInventoryCacheFromEnv() projectBucketInventoryCache

func NewStorageChainAuditResponseCacheFromEnv

func NewStorageChainAuditResponseCacheFromEnv() storageChainAuditResponseCache

func NewStorageExactProjectJoinCacheFromEnv

func NewStorageExactProjectJoinCacheFromEnv() storageExactProjectJoinCache

func NormalizeGitUploadFileName

func NormalizeGitUploadFileName(value string) (string, error)

func NormalizeGitUploadSubdirectory

func NormalizeGitUploadSubdirectory(value string) string

func NormalizeStorageChainBucketInventoryMode

func NormalizeStorageChainBucketInventoryMode(raw string) (string, bool)

func NormalizeStorageChainProbeMode

func NormalizeStorageChainProbeMode(raw string) (string, bool)

func NormalizeStorageChainValidationMode

func NormalizeStorageChainValidationMode(raw string) (string, bool)

func OpenRepository

func OpenRepository(path string) (*gogit.Repository, error)

func OrganizationConfigurationState

func OrganizationConfigurationState(appInstalled bool, configuredProjects int, totalProjects int) string

func PersistRepoAnalyticsIndex

func PersistRepoAnalyticsIndex(ctx context.Context, mirrorPath string, repo *gogit.Repository, ref string, hash plumbing.Hash) error

func ProgramProjectResourcePath

func ProgramProjectResourcePath(organization, project string) string

func RepoAnalyticsIndexPath

func RepoAnalyticsIndexPath(mirrorPath string) string

func RepositoryIsEmpty

func RepositoryIsEmpty(repo *gogit.Repository) bool

func ResolveGitReference

func ResolveGitReference(repo *gogit.Repository, requestedRef string, defaultBranch string) (string, plumbing.Hash, error)

func SyncRepositoryMirror

func SyncRepositoryMirror(ctx context.Context, remoteURL string, mirrorPath string, auth *githttp.BasicAuth) error

Types

type CalyprProjectInitializeResponse

type CalyprProjectInitializeResponse struct {
	Success      bool   `json:"success"`
	ProjectID    string `json:"project_id"`
	ResourcePath string `json:"resource_path"`
}

type CalyprProjectReadiness

type CalyprProjectReadiness struct {
	Git    CalyprReadinessCheck `json:"git"`
	Syfon  CalyprReadinessCheck `json:"syfon"`
	Config CalyprReadinessCheck `json:"config"`
}

type CalyprProjectSetupRequest

type CalyprProjectSetupRequest struct {
	Config  appconfig.ProjectConfig     `json:"config"`
	Storage *CalyprProjectStorageIntent `json:"storage,omitempty"`
}

type CalyprProjectSetupResponse

type CalyprProjectSetupResponse struct {
	ProjectID    string                 `json:"project_id"`
	ResourcePath string                 `json:"resource_path"`
	Configured   bool                   `json:"configured"`
	Readiness    CalyprProjectReadiness `json:"readiness"`
}

type CalyprProjectStorageIntent

type CalyprProjectStorageIntent struct {
	Bucket              string `json:"bucket"`
	Provider            string `json:"provider"`
	Endpoint            string `json:"endpoint"`
	Region              string `json:"region"`
	AccessKey           string `json:"access_key"`
	SecretKey           string `json:"secret_key"`
	Organization        string `json:"organization"`
	ProjectID           string `json:"project_id"`
	Path                string `json:"path,omitempty"`
	PathPrefix          string `json:"path_prefix,omitempty"`
	OrganizationSubPath string `json:"organization_sub_path,omitempty"`
	ProjectSubPath      string `json:"project_sub_path,omitempty"`
}

type CalyprProjectStorageRequest

type CalyprProjectStorageRequest struct {
	Storage *CalyprProjectStorageIntent `json:"storage"`
}

type CalyprProjectStorageResponse

type CalyprProjectStorageResponse struct {
	Success      bool                    `json:"success"`
	ProjectID    string                  `json:"project_id"`
	ResourcePath string                  `json:"resource_path"`
	Storage      ProjectIntegrationCheck `json:"storage"`
}

type CalyprReadinessCheck

type CalyprReadinessCheck struct {
	Pass    bool   `json:"pass"`
	Reason  string `json:"reason,omitempty"`
	Details string `json:"details,omitempty"`
}

type Error

type Error struct {
	Kind       ErrorKind
	Message    string
	StatusCode int
	Details    map[string]any
	Err        error
}

func NewError

func NewError(kind ErrorKind, statusCode int, message string, details map[string]any) *Error

func WrapError

func WrapError(kind ErrorKind, statusCode int, message string, cause error, details map[string]any) *Error

func (*Error) Error

func (err *Error) Error() string

func (*Error) Unwrap

func (err *Error) Unwrap() error

type ErrorKind

type ErrorKind string
const (
	ErrorKindValidation   ErrorKind = "validation"
	ErrorKindForbidden    ErrorKind = "forbidden"
	ErrorKindIntegration  ErrorKind = "integration"
	ErrorKindNotFound     ErrorKind = "not_found"
	ErrorKindDatabase     ErrorKind = "database"
	ErrorKindUnauthorized ErrorKind = "unauthorized"
)

type GitAuditEvidence

type GitAuditEvidence = storageaudit.Evidence

type GitHubInstallationRepository

type GitHubInstallationRepository = domain.GitHubInstallationRepository

GitHubInstallationRepository is an alias for domain.GitHubInstallationRepository.

type GitHubRepositoryMetadata

type GitHubRepositoryMetadata = domain.GitHubRepositoryMetadata

GitHubRepositoryMetadata is an alias for domain.GitHubRepositoryMetadata.

type GitLFSPointerInfo

type GitLFSPointerInfo struct {
	Version string `json:"version"`
	OID     string `json:"oid"`
	Size    int64  `json:"size"`
}

func ParseGitLFSPointer

func ParseGitLFSPointer(content []byte) *GitLFSPointerInfo

type GitManifestResponseOptions

type GitManifestResponseOptions struct {
	Limit     int
	Cursor    string
	FilesOnly bool
}

type GitOrganizationConnectResponse

type GitOrganizationConnectResponse struct {
	Mode           string                         `json:"mode"`
	RedirectURL    string                         `json:"redirect_url,omitempty"`
	InstallationID *int64                         `json:"installation_id,omitempty"`
	Repositories   []GitHubInstallationRepository `json:"repositories,omitempty"`
}

type GitOrganizationProjectStatus

type GitOrganizationProjectStatus struct {
	ProjectID                 string                          `json:"project_id"`
	Project                   string                          `json:"project"`
	ResourcePath              string                          `json:"resource_path"`
	Repository                GitRepositoryIdentity           `json:"repository"`
	WorkflowStage             string                          `json:"workflow_stage,omitempty"`
	Configured                bool                            `json:"configured"`
	Readiness                 *CalyprProjectReadiness         `json:"readiness,omitempty"`
	Integrations              ProjectIntegrationStatus        `json:"integrations"`
	Accessible                bool                            `json:"accessible"`
	CanManageSettings         bool                            `json:"can_manage_settings"`
	RequestAccess             bool                            `json:"request_access"`
	RequestAccessResourcePath string                          `json:"request_access_resource_path,omitempty"`
	Installation              GitRepositoryInstallationStatus `json:"installation"`
}

type GitOrganizationStatusResponse

type GitOrganizationStatusResponse struct {
	Organization        string                         `json:"organization"`
	Connected           bool                           `json:"connected"`
	AppInstalled        bool                           `json:"app_installed"`
	CanAccessSettings   bool                           `json:"can_access_settings"`
	CanCreateProjects   bool                           `json:"can_create_projects"`
	CanManagePeople     bool                           `json:"can_manage_people"`
	CanDeleteOrg        bool                           `json:"can_delete_org"`
	InstallationID      *int64                         `json:"installation_id,omitempty"`
	HTMLURL             string                         `json:"html_url,omitempty"`
	RepositorySelection string                         `json:"repository_selection,omitempty"`
	ConfigurationState  string                         `json:"configuration_state"`
	ConnectedProjects   int                            `json:"connected_projects"`
	ConfiguredProjects  int                            `json:"configured_projects"`
	TotalProjects       int                            `json:"total_projects"`
	Projects            []GitOrganizationProjectStatus `json:"projects"`
}

type GitOrganizationsStatusResponse

type GitOrganizationsStatusResponse struct {
	Connected              bool                            `json:"connected"`
	AppInstalled           bool                            `json:"app_installed"`
	ConnectedOrganizations int                             `json:"connected_organizations"`
	InstalledOrganizations int                             `json:"installed_organizations"`
	TotalOrganizations     int                             `json:"total_organizations"`
	ConnectedProjects      int                             `json:"connected_projects"`
	ConfiguredProjects     int                             `json:"configured_projects"`
	TotalProjects          int                             `json:"total_projects"`
	ConfigurationState     string                          `json:"configuration_state"`
	Organizations          []GitOrganizationStatusResponse `json:"organizations"`
}

type GitProjectDiffAuditRequest

type GitProjectDiffAuditRequest = storageaudit.ProjectDiffAuditRequest

type GitProjectDiffAuditResponse

type GitProjectDiffAuditResponse = storageaudit.ProjectDiffAuditResponse

type GitProjectDiffFinding

type GitProjectDiffFinding = storageaudit.ProjectDiffFinding

type GitProjectDiffSummary

type GitProjectDiffSummary = storageaudit.ProjectDiffSummary

type GitProjectFileResponse

type GitProjectFileResponse struct {
	ProjectID   string             `json:"project_id"`
	Ref         string             `json:"ref"`
	Path        string             `json:"path"`
	Name        string             `json:"name"`
	Hash        string             `json:"hash"`
	Size        int64              `json:"size"`
	HTMLURL     string             `json:"html_url,omitempty"`
	DownloadURL string             `json:"download_url,omitempty"`
	LFSPointer  *GitLFSPointerInfo `json:"lfs_pointer,omitempty"`
}

func BuildGitHubFileResponse

func BuildGitHubFileResponse(projectID string, ref string, path string, metadata *github.RepositoryContent, contentBytes []byte) *GitProjectFileResponse

type GitProjectManifestResponse

type GitProjectManifestResponse struct {
	ProjectID  string         `json:"project_id"`
	Ref        string         `json:"ref"`
	Path       string         `json:"path"`
	EntryCount int            `json:"entry_count"`
	HasMore    bool           `json:"has_more"`
	NextCursor string         `json:"next_cursor,omitempty"`
	Entries    []GitTreeEntry `json:"entries"`
}

func BuildGitManifestResponse

func BuildGitManifestResponse(projectID string, ref string, path string, repo *gogit.Repository, hash plumbing.Hash, options GitManifestResponseOptions) (*GitProjectManifestResponse, error)

type GitProjectRefreshResponse

type GitProjectRefreshResponse struct {
	Success        bool   `json:"success"`
	ProjectID      string `json:"project_id"`
	SyncState      string `json:"sync_state"`
	DefaultBranch  string `json:"default_branch,omitempty"`
	LastFetchedRef string `json:"last_fetched_ref,omitempty"`
	Error          string `json:"error,omitempty"`
}

type GitProjectRefsResponse

type GitProjectRefsResponse struct {
	ProjectID     string   `json:"project_id"`
	DefaultBranch string   `json:"default_branch,omitempty"`
	Refs          []GitRef `json:"refs"`
}

func BuildGitRefsResponse

func BuildGitRefsResponse(projectID string, defaultBranch string, repo *gogit.Repository) (*GitProjectRefsResponse, error)

type GitProjectStatusResponse

type GitProjectStatusResponse struct {
	ProjectID                       string                  `json:"project_id"`
	Organization                    string                  `json:"organization"`
	Project                         string                  `json:"project"`
	ResourcePath                    string                  `json:"resource_path"`
	Accessible                      bool                    `json:"accessible"`
	RequestAccess                   bool                    `json:"request_access"`
	RequestAccessResourcePath       string                  `json:"request_access_resource_path,omitempty"`
	Config                          appconfig.ProjectConfig `json:"config"`
	Repository                      GitRepositoryIdentity   `json:"repository"`
	WorkflowStage                   string                  `json:"workflow_stage,omitempty"`
	InstallationState               string                  `json:"installation_state"`
	InstallationID                  *int64                  `json:"installation_id,omitempty"`
	InstallationTarget              string                  `json:"installation_target,omitempty"`
	InstallationTargetType          string                  `json:"installation_target_type,omitempty"`
	OrganizationAppInstalled        bool                    `json:"organization_app_installed"`
	OrganizationHTMLURL             string                  `json:"organization_html_url,omitempty"`
	OrganizationRepositorySelection string                  `json:"organization_repository_selection,omitempty"`
	SyncState                       string                  `json:"sync_state"`
	DefaultBranch                   string                  `json:"default_branch,omitempty"`
	LastRefreshedAt                 *time.Time              `json:"last_refreshed_at,omitempty"`
	LastError                       string                  `json:"last_error,omitempty"`
	MirrorReady                     bool                    `json:"mirror_ready"`
}

type GitProjectTreeResponse

type GitProjectTreeResponse struct {
	ProjectID  string         `json:"project_id"`
	Ref        string         `json:"ref"`
	Path       string         `json:"path"`
	EntryCount int            `json:"entry_count"`
	Truncated  bool           `json:"truncated,omitempty"`
	Entries    []GitTreeEntry `json:"entries"`
}

func BuildGitTreeResponse

func BuildGitTreeResponse(projectID string, ref string, path string, repo *gogit.Repository, hash plumbing.Hash, options GitTreeResponseOptions) (*GitProjectTreeResponse, error)

type GitRef

type GitRef struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Hash    string `json:"hash"`
	Default bool   `json:"default"`
}

type GitRepoAnalyticsChild

type GitRepoAnalyticsChild struct {
	Name       string `json:"name"`
	Path       string `json:"path"`
	Type       string `json:"type"`
	FileCount  int    `json:"file_count"`
	TotalBytes int64  `json:"total_bytes"`
}

type GitRepoAnalyticsDirectory

type GitRepoAnalyticsDirectory struct {
	Path             string                  `json:"path"`
	DirectChildCount int                     `json:"direct_child_count"`
	FileCount        int                     `json:"file_count"`
	TotalBytes       int64                   `json:"total_bytes"`
	Children         []GitRepoAnalyticsChild `json:"children"`
}

type GitRepoAnalyticsIndexSidecar

type GitRepoAnalyticsIndexSidecar struct {
	SchemaVersion int                         `json:"schema_version"`
	CommitHash    string                      `json:"commit_hash"`
	RefName       string                      `json:"ref_name"`
	GeneratedAt   time.Time                   `json:"generated_at"`
	Files         []RepoInventoryFile         `json:"files"`
	Directories   []GitRepoAnalyticsDirectory `json:"directories"`
}

type GitRepositoryIdentity

type GitRepositoryIdentity = domain.GitRepositoryIdentity

GitRepositoryIdentity is an alias for domain.GitRepositoryIdentity.

func ParseRepositoryIdentity

func ParseRepositoryIdentity(raw string) (GitRepositoryIdentity, error)

type GitRepositoryInstallationStatus

type GitRepositoryInstallationStatus = domain.GitRepositoryInstallationStatus

GitRepositoryInstallationStatus is an alias for domain.GitRepositoryInstallationStatus.

type GitService

type GitService struct {
	// contains filtered or unexported fields
}

func NewGitService

func NewGitService(config GitServiceConfig) *GitService

func (*GitService) CreateGitHubUploadPullRequest

func (service *GitService) CreateGitHubUploadPullRequest(
	ctx context.Context,
	authorizationHeader string,
	organization string,
	project string,
	identity GitRepositoryIdentity,
	baseBranch string,
	branchName string,
	title string,
	body string,
	files []geckodb.GitUploadSessionFile,
) (string, string, error)

func (*GitService) EnsureDataDir

func (service *GitService) EnsureDataDir() error

func (*GitService) FetchRepositoryMetadata

func (service *GitService) FetchRepositoryMetadata(ctx context.Context, accessToken string, identity GitRepositoryIdentity) (*GitHubRepositoryMetadata, error)

func (*GitService) GetGitHubFileMetadata

func (service *GitService) GetGitHubFileMetadata(ctx context.Context, authorizationHeader string, organization string, project string, identity GitRepositoryIdentity, ref string, path string) (*github.RepositoryContent, []byte, error)

func (*GitService) Init

func (service *GitService) Init(db *sqlx.DB) error

func (*GitService) ListInstallationRepositories

func (service *GitService) ListInstallationRepositories(ctx context.Context, authorizationHeader string, organization string, owner string, installationID int64) ([]GitHubInstallationRepository, error)

func (*GitService) MirrorPathForIdentity

func (service *GitService) MirrorPathForIdentity(identity GitRepositoryIdentity) string

func (*GitService) RefreshProject

func (service *GitService) RefreshProject(ctx context.Context, projectID string, identity GitRepositoryIdentity, state *geckodb.GitProjectState, accessToken string) (*GitProjectRefreshResponse, *geckodb.GitProjectState, error)

func (*GitService) RequestInstallationToken

func (service *GitService) RequestInstallationToken(ctx context.Context, authorizationHeader string, organization string, project string, identity GitRepositoryIdentity, access string) (string, error)

func (*GitService) RequestInstallationURL

func (service *GitService) RequestInstallationURL(ctx context.Context, authorizationHeader string, owner string, redirectPath string) (string, error)

func (*GitService) RequestOrganizationInstallationStatus

func (service *GitService) RequestOrganizationInstallationStatus(ctx context.Context, authorizationHeader string, organization string, owner string) (GitRepositoryInstallationStatus, error)

func (*GitService) ResolveTargetAndRepositoryIDs

func (service *GitService) ResolveTargetAndRepositoryIDs(ctx context.Context, identity GitRepositoryIdentity) (int64, int64, error)

func (*GitService) StatusFromState

func (service *GitService) StatusFromState(projectID string, organization string, project string, cfg appconfig.ProjectConfig, identity GitRepositoryIdentity, state *geckodb.GitProjectState, orgState *geckodb.GitOrganizationState) GitProjectStatusResponse

type GitServiceConfig

type GitServiceConfig struct {
	DataDir       string
	GitHubAPIBase string
	FenceBaseURL  string
	HTTPClient    *http.Client
	FenceClient   *fence.Client
	GitHubClient  *gitapi.Client
}

type GitStorageChainAuditRequest

type GitStorageChainAuditRequest = storageaudit.ChainAuditRequest

type GitStorageChainAuditResponse

type GitStorageChainAuditResponse = storageaudit.ChainAuditResponse

type GitStorageChainAuditSummary

type GitStorageChainAuditSummary = storageaudit.ChainSummary

type GitStorageChainFinding

type GitStorageChainFinding = storageaudit.ChainFinding

type GitStorageChainIssueGroup

type GitStorageChainIssueGroup = storageaudit.ChainIssueGroup

type GitStorageChildResponseItem

type GitStorageChildResponseItem struct {
	Name             string `json:"name"`
	Path             string `json:"path"`
	Type             string `json:"type"`
	FileCount        int    `json:"file_count"`
	RecordCount      int    `json:"record_count"`
	TotalBytes       int64  `json:"total_bytes"`
	DownloadCount    int64  `json:"download_count"`
	LastDownloadTime string `json:"last_download_time,omitempty"`
	LatestUpdateTime string `json:"latest_update_time,omitempty"`
}

type GitStorageChildrenResponse

type GitStorageChildrenResponse struct {
	Items      []GitStorageChildResponseItem `json:"items"`
	HasMore    bool                          `json:"has_more"`
	NextCursor string                        `json:"next_cursor,omitempty"`
}

type GitStorageCleanupAccessMethod

type GitStorageCleanupAccessMethod = storageaudit.CleanupAccessMethod

type GitStorageCleanupAccessProbe

type GitStorageCleanupAccessProbe = storageaudit.CleanupAccessProbe

type GitStorageCleanupApplyAction

type GitStorageCleanupApplyAction = storageaudit.CleanupApplyAction

type GitStorageCleanupApplyFinding

type GitStorageCleanupApplyFinding = storageaudit.CleanupApplyFinding

type GitStorageCleanupApplyRequest

type GitStorageCleanupApplyRequest = storageaudit.CleanupApplyRequest

type GitStorageCleanupApplyResponse

type GitStorageCleanupApplyResponse = storageaudit.CleanupApplyResponse

type GitStorageCleanupAuditRequest

type GitStorageCleanupAuditRequest = storageaudit.CleanupAuditRequest

type GitStorageCleanupAuditResponse

type GitStorageCleanupAuditResponse = storageaudit.CleanupAuditResponse

type GitStorageCleanupAuditSummary

type GitStorageCleanupAuditSummary = storageaudit.CleanupAuditSummary

type GitStorageCleanupFinding

type GitStorageCleanupFinding = storageaudit.CleanupFinding

type GitStorageCleanupPurgeResult

type GitStorageCleanupPurgeResult = storageaudit.CleanupPurgeResult

type GitStorageCleanupRecordAudit

type GitStorageCleanupRecordAudit = storageaudit.CleanupRecordAudit

type GitStorageFolderResponse

type GitStorageFolderResponse struct {
	Summary  GitStorageSummaryResponse  `json:"summary"`
	Children GitStorageChildrenResponse `json:"children"`
}

type GitStorageSummaryResponse

type GitStorageSummaryResponse struct {
	Path               string `json:"path"`
	Source             string `json:"source,omitempty"`
	FileCount          int    `json:"file_count"`
	RecordCount        int    `json:"record_count"`
	DirectChildCount   int    `json:"direct_child_count"`
	TotalBytes         int64  `json:"total_bytes"`
	DownloadCount      int64  `json:"download_count"`
	LastDownloadTime   string `json:"last_download_time,omitempty"`
	LatestUpdateTime   string `json:"latest_update_time,omitempty"`
	DuplicatePathCount int    `json:"duplicate_path_count"`
}

type GitTreeEntry

type GitTreeEntry struct {
	Name           string             `json:"name"`
	Path           string             `json:"path"`
	Type           string             `json:"type"`
	Hash           string             `json:"hash"`
	Size           int64              `json:"size,omitempty"`
	LastModifiedAt *time.Time         `json:"last_modified_at,omitempty"`
	LFSPointer     *GitLFSPointerInfo `json:"lfs_pointer,omitempty"`
}

type GitTreeResponseOptions

type GitTreeResponseOptions struct {
	IncludeSize         bool
	IncludeLastModified bool
	IncludeLFSPointer   bool
	Limit               int
}

type GitUploadSessionAttachFilesRequest

type GitUploadSessionAttachFilesRequest struct {
	Files []GitUploadSessionFileAttachment `json:"files"`
}

type GitUploadSessionCreateRequest

type GitUploadSessionCreateRequest struct {
	BaseBranch   string                         `json:"base_branch"`
	TargetSubdir string                         `json:"target_subdirectory"`
	Files        []GitUploadSessionFileManifest `json:"files"`
}

type GitUploadSessionFileAttachment

type GitUploadSessionFileAttachment struct {
	FileName    string `json:"file_name"`
	TargetPath  string `json:"target_path"`
	Checksum    string `json:"checksum"`
	DRSObjectID string `json:"drs_object_id"`
	Size        int64  `json:"size"`
}

type GitUploadSessionFileManifest

type GitUploadSessionFileManifest struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

type GitUploadSessionFileStatus

type GitUploadSessionFileStatus struct {
	FileName    string `json:"file_name"`
	TargetPath  string `json:"target_path"`
	Size        int64  `json:"size"`
	Checksum    string `json:"checksum,omitempty"`
	DRSObjectID string `json:"drs_object_id,omitempty"`
	Status      string `json:"status"`
	Error       string `json:"error,omitempty"`
	Collision   bool   `json:"collision"`
}

type GitUploadSessionFinalizeRequest

type GitUploadSessionFinalizeRequest struct {
	PRTitle string `json:"pr_title"`
	PRBody  string `json:"pr_body"`
}

type GitUploadSessionResponse

type GitUploadSessionResponse struct {
	SessionID      string                       `json:"session_id"`
	ProjectID      string                       `json:"project_id"`
	BaseBranch     string                       `json:"base_branch"`
	TargetSubdir   string                       `json:"target_subdirectory,omitempty"`
	BranchName     string                       `json:"branch_name"`
	PRTitle        string                       `json:"pr_title"`
	PRBody         string                       `json:"pr_body"`
	Status         string                       `json:"status"`
	PullRequestURL string                       `json:"pull_request_url,omitempty"`
	CommitSHA      string                       `json:"commit_sha,omitempty"`
	Files          []GitUploadSessionFileStatus `json:"files"`
	HasConflicts   bool                         `json:"has_conflicts"`
}

type HTTPStatusError

type HTTPStatusError = domain.HTTPStatusError

HTTPStatusError is an alias for domain.HTTPStatusError.

type ProjectIntegrationCheck

type ProjectIntegrationCheck struct {
	Pass    bool   `json:"pass"`
	Reason  string `json:"reason,omitempty"`
	Details string `json:"details,omitempty"`
}

type ProjectIntegrationStatus

type ProjectIntegrationStatus struct {
	GitHub  ProjectIntegrationCheck `json:"github"`
	Storage ProjectIntegrationCheck `json:"storage"`
}

type ReconcileService

type ReconcileService struct {
	// contains filtered or unexported fields
}

func NewReconcileService

func NewReconcileService(db *sqlx.DB, storage *syfon.Manager, gitService *GitService) *ReconcileService

func (*ReconcileService) BuildOrganizationStatus

func (service *ReconcileService) BuildOrganizationStatus(ctx context.Context, organization string, projectIDs []string, projectStates map[string]geckodb.GitProjectState, organizationStates map[string]geckodb.GitOrganizationState, allowedResources []string, buckets map[string]StorageBucket, bucketsErr error) (GitOrganizationStatusResponse, error)

func (*ReconcileService) BuildOrganizationsStatus

func (service *ReconcileService) BuildOrganizationsStatus(ctx context.Context, authorizationHeader string, projectIDs []string, allowedResources []string) (GitOrganizationsStatusResponse, error)

func (*ReconcileService) BuildSingleOrganizationStatus

func (service *ReconcileService) BuildSingleOrganizationStatus(ctx context.Context, authorizationHeader string, organization string, projectIDs []string, allowedResources []string) (GitOrganizationStatusResponse, error)

func (*ReconcileService) ReconcileOrganization

func (service *ReconcileService) ReconcileOrganization(ctx context.Context, organization string, authorizationHeader string, projectIDs []string) error

func (*ReconcileService) ReconcileOrganizations

func (service *ReconcileService) ReconcileOrganizations(ctx context.Context, authorizationHeader string, projectIDs []string) error

type RepoInventoryFile

type RepoInventoryFile struct {
	RepoPath string
	Name     string
	Checksum string
	Size     int64
}

type SetupService

type SetupService struct {
	// contains filtered or unexported fields
}

func NewSetupService

func NewSetupService(db *sqlx.DB, gitService *GitService, storage *syfon.Manager, accessChecks *servermw.FenceUserAccessHandler) *SetupService

func (*SetupService) CleanupProjectStorage

func (service *SetupService) CleanupProjectStorage(ctx context.Context, authorizationHeader, organization, project string) error

func (*SetupService) InitializeProject

func (service *SetupService) InitializeProject(ctx context.Context, authorizationHeader, organization, project string, request CalyprProjectSetupRequest) (*CalyprProjectInitializeResponse, error)

func (*SetupService) PopulateStorage

func (service *SetupService) PopulateStorage(ctx context.Context, authorizationHeader, organization, project string, request CalyprProjectStorageRequest) (*CalyprProjectStorageResponse, error)

func (*SetupService) PopulateStorageIntent

func (service *SetupService) PopulateStorageIntent(ctx context.Context, authorizationHeader string, intent *CalyprProjectStorageIntent) error

func (*SetupService) StorageCheck

func (service *SetupService) StorageCheck(ctx context.Context, authorizationHeader, organization, project string) (ProjectIntegrationCheck, error)

type StorageAnalyticsService

type StorageAnalyticsService struct {
	// contains filtered or unexported fields
}

func NewStorageAnalyticsService

func NewStorageAnalyticsService(storage storageAnalyticsBackend) *StorageAnalyticsService

func (*StorageAnalyticsService) ApplyStorageCleanup

func (service *StorageAnalyticsService) ApplyStorageCleanup(ctx context.Context, authorizationHeader string, organization string, project string, selectedRepoPaths []string, selectedActions []GitStorageCleanupApplyAction, selectedFindings []GitStorageCleanupApplyFinding, deleteRepoOrphans bool, deleteStaleDuplicates bool, deleteBucketOnlyObjects bool, repairBrokenBucketMappings bool, dryRun bool) (*GitStorageCleanupApplyResponse, error)

func (*StorageAnalyticsService) BuildProjectDiffAudit

func (service *StorageAnalyticsService) BuildProjectDiffAudit(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash) (*GitProjectDiffAuditResponse, error)

func (*StorageAnalyticsService) BuildStorageChainAuditWithOptions

func (service *StorageAnalyticsService) BuildStorageChainAuditWithOptions(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash, options StorageChainAuditOptions) (*GitStorageChainAuditResponse, error)

func (*StorageAnalyticsService) BuildStorageChildren

func (service *StorageAnalyticsService) BuildStorageChildren(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash, limit int, sortBy string, sortOrder string, cursor string) (*GitStorageChildrenResponse, error)

func (*StorageAnalyticsService) BuildStorageCleanupAudit

func (service *StorageAnalyticsService) BuildStorageCleanupAudit(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, selectedRepoPaths []string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash, checkStorage bool) (*GitStorageCleanupAuditResponse, *cleanupAuditModel, error)

func (*StorageAnalyticsService) BuildStorageFolder

func (service *StorageAnalyticsService) BuildStorageFolder(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash, limit int, sortBy string, sortOrder string, cursor string, summaryMode string, forceRefresh bool, timings *StorageFolderTimings) (*GitStorageFolderResponse, error)

func (*StorageAnalyticsService) BuildStorageSummary

func (service *StorageAnalyticsService) BuildStorageSummary(ctx context.Context, authorizationHeader string, organization string, project string, ref string, gitSubpath string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash) (*GitStorageSummaryResponse, error)

func (*StorageAnalyticsService) EnableStorageChainAuditResponseCacheFromEnv

func (service *StorageAnalyticsService) EnableStorageChainAuditResponseCacheFromEnv()

func (*StorageAnalyticsService) RegisterGitOnlySyfonRecords

func (service *StorageAnalyticsService) RegisterGitOnlySyfonRecords(ctx context.Context, authorizationHeader string, organization string, project string, ref string, mirrorPath string, repo *gogit.Repository, hash plumbing.Hash, request GitOnlySyfonRegistrationRequest) (*GitOnlySyfonRegistrationResponse, error)

RegisterGitOnlySyfonRecords restores only missing Syfon records. It always re-reads the Git LFS pointer, confirms the current scoped bucket object, and rejects size drift before sending a DRS registration request to Syfon.

type StorageBucket

type StorageBucket = domain.StorageBucket

StorageBucket is an alias for domain.StorageBucket.

type StorageChainAuditOptions

type StorageChainAuditOptions struct {
	ProbeMode           string
	ValidationMode      string
	BucketInventoryMode string
	BucketPathPrefix    string
	FindingKind         string
	FindingLimit        int
	ForceAuditRefresh   bool
	Timings             *StorageChainAuditTimings
}

type StorageChainAuditStageTiming

type StorageChainAuditStageTiming struct {
	Stage    string
	Duration time.Duration
}

type StorageChainAuditTimings

type StorageChainAuditTimings struct {
	Logf        func(format string, args ...any)
	DebugPrefix string
	// contains filtered or unexported fields
}

func (*StorageChainAuditTimings) Record

func (timings *StorageChainAuditTimings) Record(stage string, duration time.Duration)

func (*StorageChainAuditTimings) RecordMemory

func (timings *StorageChainAuditTimings) RecordMemory(stage string, fields ...any)

func (*StorageChainAuditTimings) Snapshot

func (*StorageChainAuditTimings) StageStart

func (timings *StorageChainAuditTimings) StageStart(stage string)

type StorageConfig

type StorageConfig = domain.StorageConfig

StorageConfig is an alias for domain.StorageConfig.

type StorageFolderTimings

type StorageFolderTimings struct {
	DebugPrefix string
	Logf        func(format string, args ...any)
}

func (*StorageFolderTimings) Record

func (timings *StorageFolderTimings) Record(stage string, duration time.Duration)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL