importer

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LAMBDA_SCHEME string = "lambda"
View Source
const NULL_SCHEME string = "null"

Variables

This section is empty.

Functions

func RegisterImporter

func RegisterImporter(ctx context.Context, scheme string, init_func ImporterInitializationFunc) error

RegisterImporter registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `Importer` instances by the `NewImporter` method.

func Schemes

func Schemes() []string

Schemes returns the list of schemes that have been registered.

Types

type ImportEvent

type ImportEvent struct {
	Ids []int64 `json:"ids"`
}

type Importer

type Importer interface {
	ImportIDs(context.Context, ...int64) error
}

func NewImporter

func NewImporter(ctx context.Context, uri string) (Importer, error)

NewImporter returns a new `Importer` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `ImporterInitializationFunc` function used to instantiate the new `Importer`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterImporter` method.

func NewLambdaImporter

func NewLambdaImporter(ctx context.Context, uri string) (Importer, error)

func NewNullImporter

func NewNullImporter(ctx context.Context, uri string) (Importer, error)

type ImporterInitializationFunc

type ImporterInitializationFunc func(ctx context.Context, uri string) (Importer, error)

ImporterInitializationFunc is a function defined by individual importer package and used to create an instance of that importer

type LambdaImporter

type LambdaImporter struct {
	Importer
	// contains filtered or unexported fields
}

func (*LambdaImporter) ImportIDs

func (i *LambdaImporter) ImportIDs(ctx context.Context, ids ...int64) error

type NullImporter

type NullImporter struct {
	Importer
}

func (*NullImporter) ImportIDs

func (i *NullImporter) ImportIDs(ctx context.Context, ids ...int64) error

Jump to

Keyboard shortcuts

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