constants

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package constants defines shared implementation limits and defaults.

Index

Constants

View Source
const (
	// DefaultHTTPTimeout is the standard timeout for HTTP requests to provider APIs.
	DefaultHTTPTimeout = 30 * time.Second

	// DefaultTimeout is the standard timeout for general operations.
	DefaultTimeout = 10 * time.Second

	// DefaultCatalogProjectionTimeout bounds full-catalog filesystem
	// projection and startup repair.
	DefaultCatalogProjectionTimeout = time.Minute

	// UpdateContextTimeout is the timeout for each catalog update operation.
	UpdateContextTimeout = 5 * time.Minute

	// ProviderFetchTimeout is the timeout for fetching models from a single provider.
	ProviderFetchTimeout = 2 * time.Minute

	// SyncCleanupTimeout is the timeout for source cleanup after sync operations.
	SyncCleanupTimeout = 30 * time.Second

	// CatalogStoreLockRetryDelay is the retry interval for a contended filesystem commit lock.
	CatalogStoreLockRetryDelay = 10 * time.Millisecond
)

Timeout constants define various timeout durations used in the application.

View Source
const (
	// DirPermissions is the default permission for created directories (rwxr-xr-x).
	DirPermissions = 0755

	// FilePermissions is the default permission for created files (rw-r--r--).
	FilePermissions = 0644

	// ExecutablePermissions is for executable files (rwxr-xr-x).
	ExecutablePermissions = 0755

	// SecureFilePermissions is for sensitive files like API keys (rw-------).
	SecureFilePermissions = 0600
)

File permission constants define standard Unix file permissions.

View Source
const (
	// MaxConcurrentProviders is the maximum number of providers to sync concurrently.
	MaxConcurrentProviders = 5

	// MaxCatalogModels is the maximum number of models in a catalog.
	MaxCatalogModels = 10000

	// MaxProviders is the maximum number of providers.
	MaxProviders = 100

	// MaxSourceProviders bounds provider records in one external source payload.
	// Source catalogs may include aliases and upstreams that do not become
	// canonical Starmap providers.
	MaxSourceProviders = 512

	// MaxSourcePayloadBytes is the source payload package's public byte limit.
	MaxSourcePayloadBytes = sourcepayload.MaxBytes

	// MaxServerRequestBodyBytes bounds one JSON request accepted by the HTTP
	// server. Current request schemas are small query descriptions, not catalog
	// payloads.
	MaxServerRequestBodyBytes = 1 << 20
)

Limit constants define various limits and capacities.

View Source
const (
	// DefaultCatalogPath is the default human-editable provider YAML workspace.
	DefaultCatalogPath = "~/.starmap/catalog"

	// DefaultCatalogStatePath is the CLI's machine-owned immutable generation
	// database. Go consumers normally provide their own storage.Store.
	DefaultCatalogStatePath = "~/.starmap/state/catalog"

	// DefaultCachePath is the default path for cache files.
	DefaultCachePath = "~/.starmap/cache"

	// DefaultLogsPath is the default path for log files.
	DefaultLogsPath = "~/.starmap/logs"

	// DefaultSourcesPath is the default path for external source data.
	DefaultSourcesPath = "~/.starmap/sources"
)

Path constants.

View Source
const (
	// CacheTTL is the default time-to-live for cached data.
	CacheTTL = 15 * time.Minute
)
View Source
const (
	// ModelsDevGit is the Git URL for the models.dev repository.
	ModelsDevGit = "https://github.com/neuralmagic/models.dev.git"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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