importer

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service handles importing seed data into the registry

func NewService

func NewService(registry service.RegistryService) *Service

NewService creates a new importer service with sane defaults

func (*Service) ImportFromPath

func (s *Service) ImportFromPath(ctx context.Context, path string, enrichServerData bool) error

ImportFromPath imports seed data from various sources: 1. Local file paths (*.json files) - expects ServerJSON array format 2. Direct HTTP URLs to seed.json files - expects ServerJSON array format 3. Registry API endpoints (e.g., /v0/servers, /v0.1/servers) - handles pagination automatically

func (*Service) SetEmbeddingDimensions added in v0.1.11

func (s *Service) SetEmbeddingDimensions(dimensions int)

SetEmbeddingDimensions sets the expected embedding dimensions for validation.

func (*Service) SetEmbeddingProvider added in v0.1.11

func (s *Service) SetEmbeddingProvider(provider embeddings.Provider)

SetEmbeddingProvider configures the embedding provider used for semantic enrichment.

func (*Service) SetGenerateEmbeddings added in v0.1.11

func (s *Service) SetGenerateEmbeddings(enabled bool)

SetGenerateEmbeddings toggles whether embeddings should be generated during import.

func (*Service) SetGitHubToken

func (s *Service) SetGitHubToken(token string)

SetGitHubToken sets a token used only for GitHub enrichment calls

func (*Service) SetHTTPClient

func (s *Service) SetHTTPClient(client *http.Client)

SetHTTPClient overrides the HTTP client used for fetches

func (*Service) SetProgressCachePath

func (s *Service) SetProgressCachePath(path string)

SetProgressCachePath configures a file used to persist import progress between runs.

func (*Service) SetReadmeSeedPath

func (s *Service) SetReadmeSeedPath(path string)

SetReadmeSeedPath configures an optional README seed file used for imports.

func (*Service) SetRequestHeaders

func (s *Service) SetRequestHeaders(headers map[string]string)

SetRequestHeaders replaces headers used for HTTP fetches

func (*Service) SetUpdateIfExists

func (s *Service) SetUpdateIfExists(update bool)

SetUpdateIfExists toggles replacing existing name/version entries instead of skipping

Jump to

Keyboard shortcuts

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