Documentation
¶
Index ¶
- type Cache
- func (c *Cache) CleanExpired()
- func (c *Cache) Clear() error
- func (c *Cache) GetCacheDir() string
- func (c *Cache) GetCacheStats() map[string]interface{}
- func (c *Cache) GetPackageMetadata(name string) (*PackageMetadata, bool)
- func (c *Cache) GetTarball(key string) (string, bool)
- func (c *Cache) SetPackageMetadata(name string, metadata *PackageMetadata)
- func (c *Cache) SetTarball(key, path string)
- type Client
- func (c *Client) Download(name, version string) (string, error)
- func (c *Client) GetConfig() *RegistryConfig
- func (c *Client) GetPackage(name string) (*PackageMetadata, error)
- func (c *Client) GetPackageVersion(name, version string) (*PackageVersion, error)
- func (c *Client) Install(name, version, targetDir string) error
- func (c *Client) Publish(req *PublishRequest) error
- func (c *Client) Search(query *SearchQuery) ([]*SearchResult, error)
- func (c *Client) SetToken(token string)
- type DownloadInfo
- type Package
- type PackageMetadata
- type PackageVersion
- type PublishRequest
- type RegistryConfig
- type SearchQuery
- type SearchResult
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache manages local cache for registry data
func (*Cache) CleanExpired ¶
func (c *Cache) CleanExpired()
CleanExpired removes expired cache entries
func (*Cache) GetCacheDir ¶
GetCacheDir returns the cache directory path
func (*Cache) GetCacheStats ¶
GetCacheStats returns cache statistics
func (*Cache) GetPackageMetadata ¶
func (c *Cache) GetPackageMetadata(name string) (*PackageMetadata, bool)
GetPackageMetadata retrieves package metadata from cache
func (*Cache) GetTarball ¶
GetTarball retrieves tarball path from cache
func (*Cache) SetPackageMetadata ¶
func (c *Cache) SetPackageMetadata(name string, metadata *PackageMetadata)
SetPackageMetadata stores package metadata in cache
func (*Cache) SetTarball ¶
SetTarball stores tarball path in cache
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a registry client
func NewClient ¶
func NewClient(config *RegistryConfig) (*Client, error)
NewClient creates a new registry client
func (*Client) GetConfig ¶
func (c *Client) GetConfig() *RegistryConfig
GetConfig returns the registry configuration
func (*Client) GetPackage ¶
func (c *Client) GetPackage(name string) (*PackageMetadata, error)
GetPackage retrieves package metadata from the registry
func (*Client) GetPackageVersion ¶
func (c *Client) GetPackageVersion(name, version string) (*PackageVersion, error)
GetPackageVersion retrieves a specific version of a package
func (*Client) Publish ¶
func (c *Client) Publish(req *PublishRequest) error
Publish publishes a package to the registry
func (*Client) Search ¶
func (c *Client) Search(query *SearchQuery) ([]*SearchResult, error)
Search searches for packages in the registry
type DownloadInfo ¶
type DownloadInfo struct {
PackageName string `json:"packageName"`
Version string `json:"version"`
TarballURL string `json:"tarballUrl"`
Checksum string `json:"checksum"`
Size int64 `json:"size"`
}
DownloadInfo represents package download information
type Package ¶
type Package struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
License string `json:"license"`
Homepage string `json:"homepage,omitempty"`
Repository string `json:"repository,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Main string `json:"main"`
Scripts map[string]string `json:"scripts,omitempty"`
Dependencies map[string]string `json:"dependencies,omitempty"`
DevDependencies map[string]string `json:"devDependencies,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Downloads int `json:"downloads"`
Verified bool `json:"verified"`
}
Package represents a package in the registry
type PackageMetadata ¶
type PackageMetadata struct {
Name string `json:"name"`
Description string `json:"description"`
Author string `json:"author"`
License string `json:"license"`
Homepage string `json:"homepage,omitempty"`
Repository string `json:"repository,omitempty"`
Keywords []string `json:"keywords,omitempty"`
Versions map[string]*PackageVersion `json:"versions"`
LatestVersion string `json:"latestVersion"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Downloads int `json:"downloads"`
Verified bool `json:"verified"`
}
PackageMetadata represents complete package metadata with all versions
type PackageVersion ¶
type PackageVersion struct {
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
Main string `json:"main"`
Dependencies map[string]string `json:"dependencies,omitempty"`
DevDependencies map[string]string `json:"devDependencies,omitempty"`
TarballURL string `json:"tarballUrl"`
Shasum string `json:"shasum"`
PublishedAt time.Time `json:"publishedAt"`
Deprecated bool `json:"deprecated,omitempty"`
}
PackageVersion represents a specific version of a package
type PublishRequest ¶
type PublishRequest struct {
Package *Package `json:"package"`
Tarball []byte `json:"tarball"` // Gzipped tar archive
Checksum string `json:"checksum"`
}
PublishRequest represents a package publish request
type RegistryConfig ¶
type RegistryConfig struct {
URL string `json:"url"`
Token string `json:"token,omitempty"`
CacheDir string `json:"cacheDir"`
Timeout int `json:"timeout"` // seconds
}
RegistryConfig represents registry configuration
type SearchQuery ¶
type SearchQuery struct {
Query string `json:"query"`
Keywords []string `json:"keywords,omitempty"`
Author string `json:"author,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}
SearchQuery represents a package search query
type SearchResult ¶
type SearchResult struct {
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Author string `json:"author"`
Keywords []string `json:"keywords,omitempty"`
Downloads int `json:"downloads"`
Verified bool `json:"verified"`
Score float64 `json:"score"` // Search relevance score
}
SearchResult represents a package search result