factory

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create creates a new Importer instance for the given client and configuration.

func Register

func Register(importType config.ImportType, fn ImporterFunc)

Register registers a function that creates an Importer instance for a given import type. It panics if the same import type is registered twice to prevent duplications at compile-time.

func Replace

func Replace(importType config.ImportType, fn ImporterFunc)

Replace overwrites the ImporterFunc for the given import type. Unlike Register, it does not panic on duplicates. Use in tests to inject custom importers.

Types

type ImporterFunc

type ImporterFunc func(ctx context.Context, client config.ClientInterface, cfg config.Config) (types.Importer, error)

ImporterFunc is a function that creates an Importer instance.

Jump to

Keyboard shortcuts

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