host

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IngestHosts

func IngestHosts(ctx context.Context, gdb *gorm.DB, in []*pb.Host) ([]*pb.Host, error)

IngestHosts folds the given hosts into the shared host table non-destructively — the same additive, idempotent merge Upsert performs (host.MergeHost / host.SameHost) — and returns the persisted rows, each carrying its DB-assigned ID. It is the entry point other domains use to unify the hosts they observed with the global host records: a scan Run, for instance, folds its hosts through here and then links the returned shared rows via its own join table, rather than inserting a private copy of every host per run. The passed *gorm.DB may be a transaction, so the caller's own writes and this fold commit or roll back together.

func New

func New(db *gorm.DB) *server

New returns a new database host server, from a given db.

func NewUsers

func NewUsers(db *gorm.DB) *userServer

func WithPreloads

func WithPreloads(from *hosts.HostFilters) (clauses map[string]bool)

WithPreloads returns a map DB clauses, to dynamically load child struct fields.

Types

This section is empty.

Jump to

Keyboard shortcuts

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