js

package
v0.0.19-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: AGPL-3.0 Imports: 19 Imported by: 2

Documentation

Overview

Package js contains the functions to update the JS mirror

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Follow

func Follow(db *bun.DB, db_config *bun.DB) error

Follow is a function that imports JavaScript packages into a graph database. It takes a collection, a graph, and a graphLicenses as input parameters. It returns an error if there is any issue during the import process.

func ImportList

func ImportList(db *bun.DB, topPackages []string) error

func ImportListWithBatching

func ImportListWithBatching(db *bun.DB, topPackages []string) error

ImportListWithBatching imports a list of JavaScript packages using batch processing for improved performance

func ImportTop10000

func ImportTop10000(db *bun.DB, db_config *bun.DB) error

func UpdatePackage

func UpdatePackage(db *bun.DB, name string) error

UpdatePackage updates a package in the graph database with the given name. It downloads the package information, creates package and link information, adds licenses for each package and version, and updates the package and link information in the graph database.

Parameters: - graph: The graph database to update the package in. - graphLicenses: The graph database to update the link licenses in. - name: The name of the package to update.

Returns: - An error if any occurred during the update process, or nil if the update was successful.

func UpdatePackagesBatch

func UpdatePackagesBatch(db *bun.DB, packageNames []string) error

UpdatePackagesBatch updates multiple JavaScript packages in a single optimized batch operation

Types

type Config

type Config struct {
	Key  string `json:"_key"`
	Last int    `json:"last"`
}

type NpmChanges

type NpmChanges struct {
	Last_seq string      `json:"last_seq"`
	Results  []NpmResult `json:"results"`
}

type NpmResult

type NpmResult struct {
	Changes []struct {
		Rev string `json:"rev"`
	} `json:"changes"`
	ID      string `json:"id"`
	Seq     string `json:"seq"`
	Deleted bool   `json:"deleted"`
}

Jump to

Keyboard shortcuts

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