projectregistry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DigestStatusCompleted = "completed"
	DigestStatusFailed    = "failed"
)
View Source
const (
	DigestModeMetadataOnly        = "metadata_only"
	DigestModeContentGraph        = "content_graph"
	UpdatePolicyManual            = "manual"
	UpdatePolicyLive              = "live"
	WorkspaceModeDisabled         = "disabled"
	WorkspaceModeReadOnly         = "read_only"
	WorkspaceModeEdit             = "edit"
	GraphStoragePersistent        = "persistent"
	GraphStorageInMemory          = "in_memory"
	ClassificationInternal        = "internal"
	SensitiveMarkerPolicySkipFile = "skip_file"
	ValidationStatusValid         = "valid"
)

Variables

View Source
var (
	ErrDigestProjectNotFound = ErrProjectNotFound
	ErrDigestProjectDisabled = errors.New("digest project disabled")
	ErrDigestUnsupported     = errors.New("digest unsupported")
)
View Source
var (
	ErrProjectNotFound = errors.New("project not found")
	ErrInvalidInput    = errors.New("invalid project input")
)

Functions

func ProjectExcludesRelativePath

func ProjectExcludesRelativePath(project Project, relativePath string) bool

func ProjectGraphPath added in v0.1.3

func ProjectGraphPath(baseLadybugPath string, projectID string) (string, error)

func ProjectGraphStorageKey added in v0.1.3

func ProjectGraphStorageKey(projectID string) (string, error)

func ProjectIncludesRelativePath

func ProjectIncludesRelativePath(project Project, relativePath string) bool

func ProjectMayIncludeRelativePath

func ProjectMayIncludeRelativePath(project Project, relativePath string) bool

func ProjectSearchPath added in v0.1.3

func ProjectSearchPath(baseLadybugPath string, projectID string) (string, error)

Types

type DigestRun

type DigestRun struct {
	ID             string
	ProjectID      string
	GraphNamespace string
	Status         string
	FilesScanned   int
	FilesStored    int
	FilesSkipped   int
	StartedAt      time.Time
	CompletedAt    time.Time
}

type DigestRunMetadata

type DigestRunMetadata struct {
	ID             string    `json:"id"`
	ProjectID      string    `json:"project_id"`
	GraphNamespace string    `json:"graph_namespace"`
	Status         string    `json:"status"`
	FilesScanned   int       `json:"files_scanned"`
	FilesStored    int       `json:"files_stored"`
	FilesSkipped   int       `json:"files_skipped"`
	StartedAt      time.Time `json:"started_at"`
	CompletedAt    time.Time `json:"completed_at"`
}

func MetadataForDigestRun

func MetadataForDigestRun(run DigestRun) DigestRunMetadata

type DigestService

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

func NewDigestService

func NewDigestService(registry *Registry, graph digestGraph) *DigestService

func (*DigestService) Digest

func (svc *DigestService) Digest(ctx context.Context, project Project) (DigestRun, error)

func (*DigestService) DigestProject

func (svc *DigestService) DigestProject(ctx context.Context, projectID string) (DigestRun, error)

func (*DigestService) GetDigestRun

func (svc *DigestService) GetDigestRun(ctx context.Context, projectID string, runID string) (DigestRun, error)

type GraphStorageDiagnostic added in v0.1.3

type GraphStorageDiagnostic struct {
	ProjectID    string `json:"project_id"`
	Backend      string `json:"backend"`
	StorageKey   string `json:"storage_key,omitempty"`
	Open         bool   `json:"open,omitempty"`
	Leases       int    `json:"leases,omitempty"`
	OpenTotal    int    `json:"open_total,omitempty"`
	CloseTotal   int    `json:"close_total,omitempty"`
	BlockedClose int    `json:"blocked_close,omitempty"`
}

type Options

type Options struct {
	LadybugPath                  string
	SQLitePath                   string
	ContentGraphEnabled          bool
	LiveUpdatesEnabled           bool
	ContentGraphApprovalAccepted bool
}

type Project

type Project struct {
	ID                    string
	Aliases               []string
	DisplayName           string
	Description           string
	RootPath              string
	CanonicalRootPath     string
	Enabled               bool
	Classification        string
	GraphNamespace        string
	GraphStorage          string
	DigestMode            string
	UpdatePolicy          string
	WorkspaceMode         string
	Include               []string
	Exclude               []string
	FollowSymlinks        bool
	MaxFileBytes          int64
	MaxChunkBytes         int
	SensitiveMarkerPolicy string
	Integrations          ProjectIntegrationsMetadata
	ValidationStatus      string
	ValidationError       string
}

type ProjectGraphBackend added in v0.1.3

type ProjectGraphBackend struct {
	ProjectID  string
	Graph      ladybug.Graph
	StorageKey string
}

type ProjectGraphRouter

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

func NewProjectGraphRouter

func NewProjectGraphRouter(registry *Registry, memory ladybug.Graph, persistent ladybug.Graph) *ProjectGraphRouter

func NewProjectScopedGraphRouter added in v0.1.3

func NewProjectScopedGraphRouter(registry *Registry, memory ladybug.Graph, persistentBackends []ProjectGraphBackend) *ProjectGraphRouter

func (*ProjectGraphRouter) Batch

func (router *ProjectGraphRouter) Batch(ctx context.Context, fn func(ladybug.Graph) error) error

func (*ProjectGraphRouter) BatchProject added in v0.1.4

func (router *ProjectGraphRouter) BatchProject(ctx context.Context, projectID string, fn func(ladybug.Graph) error) error

func (*ProjectGraphRouter) Bootstrap

func (router *ProjectGraphRouter) Bootstrap(ctx context.Context, graphSchema schema.GraphSchema) error

func (*ProjectGraphRouter) DeleteDerivedFileNodes

func (router *ProjectGraphRouter) DeleteDerivedFileNodes(ctx context.Context, projectID string, repoFileID string) error

func (*ProjectGraphRouter) DeleteNodes

func (router *ProjectGraphRouter) DeleteNodes(ctx context.Context, label string, filter map[string]string) error

func (*ProjectGraphRouter) GetNode

func (router *ProjectGraphRouter) GetNode(ctx context.Context, label string, id string) (ladybug.Node, error)

func (*ProjectGraphRouter) GraphStorageDiagnostics added in v0.1.3

func (router *ProjectGraphRouter) GraphStorageDiagnostics() []GraphStorageDiagnostic

func (*ProjectGraphRouter) ListNodes

func (router *ProjectGraphRouter) ListNodes(ctx context.Context, label string, filter map[string]string) ([]ladybug.Node, error)

func (*ProjectGraphRouter) ListRelationships

func (router *ProjectGraphRouter) ListRelationships(ctx context.Context, relationshipType string, filter ladybug.RelationshipFilter) ([]ladybug.Relationship, error)

func (*ProjectGraphRouter) PutNode

func (router *ProjectGraphRouter) PutNode(ctx context.Context, node ladybug.Node) error

func (*ProjectGraphRouter) PutRelationship

func (router *ProjectGraphRouter) PutRelationship(ctx context.Context, relationship ladybug.Relationship) error

type ProjectIntegrationProviderMetadata

type ProjectIntegrationProviderMetadata struct {
	Enabled          bool   `json:"enabled"`
	AuthMode         string `json:"auth_mode,omitempty"`
	CredentialSource string `json:"credential_source,omitempty"`
	ProjectKeyCount  int    `json:"project_key_count,omitempty"`
	SpaceKeyCount    int    `json:"space_key_count,omitempty"`
	IngestionEnabled bool   `json:"ingestion_enabled"`
}

type ProjectIntegrationsMetadata

type ProjectIntegrationsMetadata struct {
	Jira       *ProjectIntegrationProviderMetadata `json:"jira,omitempty"`
	Confluence *ProjectIntegrationProviderMetadata `json:"confluence,omitempty"`
}

type ProjectMetadata

type ProjectMetadata struct {
	ID               string                       `json:"id"`
	Aliases          []string                     `json:"aliases,omitempty"`
	DisplayName      string                       `json:"display_name"`
	Description      string                       `json:"description,omitempty"`
	Enabled          bool                         `json:"enabled"`
	Classification   string                       `json:"classification"`
	GraphNamespace   string                       `json:"graph_namespace"`
	GraphStorage     string                       `json:"graph_storage"`
	DigestMode       string                       `json:"digest_mode"`
	UpdatePolicy     string                       `json:"update_policy"`
	WorkspaceMode    string                       `json:"workspace_mode"`
	ValidationStatus string                       `json:"validation_status"`
	ValidationError  string                       `json:"validation_error,omitempty"`
	Integrations     *ProjectIntegrationsMetadata `json:"integrations,omitempty"`
}

func MetadataForProject

func MetadataForProject(project Project) ProjectMetadata

func MetadataForProjects

func MetadataForProjects(projects []Project) []ProjectMetadata

type Registry

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

func NewRegistry

func NewRegistry(configProjects []config.Project, options Options) (*Registry, error)

func (*Registry) Get

func (registry *Registry) Get(id string) (Project, bool)

func (*Registry) List

func (registry *Registry) List() []Project

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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