ctemid

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: GPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ctemid provides the application service that mirrors the CTEM-ID catalog from an external JSON feed (default https://ctem.org/source.json) into local reference storage, mirroring the KEV/EPSS threat-intel refresh pattern. The refresh is fail-open: a feed outage returns an error the caller logs and tolerates; it never panics and never blocks ingest.

Index

Constants

View Source
const (
	// DefaultFeedURL is the CTEM-ID catalog feed, CVE-like, published as JSON.
	DefaultFeedURL = "https://ctem.org/source.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service refreshes and reads the CTEM-ID catalog.

func NewService

func NewService(repo ctemid.Repository, feedURL string, log *logger.Logger) *Service

NewService creates a Service. An empty feedURL defaults to DefaultFeedURL.

func (*Service) Count

func (s *Service) Count(ctx context.Context) (int, error)

Count proxies the repository count.

func (*Service) FeedURL

func (s *Service) FeedURL() string

FeedURL returns the configured feed URL (for diagnostics).

func (*Service) List

func (s *Service) List(ctx context.Context, category *string, limit, offset int) ([]*ctemid.CTEMID, int, error)

List proxies the repository list.

func (*Service) SyncCatalog

func (s *Service) SyncCatalog(ctx context.Context) (int, error)

SyncCatalog fetches the CTEM-ID feed and upserts it. Fail-open: any error is returned for the caller to log; nothing panics. Returns the number of entries upserted.

Jump to

Keyboard shortcuts

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