Help us shape the future of Go! Take the 2026 Go Developer Survey

importstore

package
v0.136.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("importer: invalid batch")

ErrInvalid is a batch refused as a whole.

Functions

This section is empty.

Types

type Options

type Options struct {
	Pool     *pgxpool.Pool
	Schema   string
	Tenant   string
	Catalog  *catalogstore.Store
	Entities *entitystore.Store
	Channels *channelstore.Store
	Content  *contentstore.Runtime
	// Signals is nil, or answers discovery.ErrNoSignals, without a signal
	// plane: signals are skipped.
	Signals *discoverystore.Service
	// Rebuild queues the jobs that rebuild what an import changed: search
	// documents, entity counts and listing counts.
	Rebuild func(ctx context.Context) error
	Logger  *slog.Logger
}

Options configures a Service over the engine's stores.

type Service

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

Service is one tenant's bulk import.

func New

func New(o Options) (*Service, error)

New checks the options.

func (*Service) ExternalIDs

ExternalIDs pages the external ids imports under q.Source hold, per entity.

func (*Service) Handler

func (s *Service) Handler(a auth.Authenticator) (http.Handler, error)

Handler serves POST /v1/import and /v1/import/external-ids to holders of access.ImportWrite.

func (*Service) Import

func (s *Service) Import(ctx context.Context, b importer.Batch) (importer.Result, error)

Import writes a batch, section by section. It fails as a whole only for a batch it refuses outright or when ctx ends; records that fail are in the result.

Jump to

Keyboard shortcuts

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