importer

package
v0.0.0-...-2a7d404 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LinuxOnly

func LinuxOnly(importers ...sdk.Importer) sdk.Importer

func MacOnly

func MacOnly(importers ...sdk.Importer) sdk.Importer

func NoOp

func NoOp() sdk.Importer

NoOp can be used as an importer stub while developing plugins.

func SanitizeNameHint

func SanitizeNameHint(nameHint string) string

SanitizeNameHint can be used to sanitize the name hint before passing it to the import candidate to improve the suggested item title.

func SourceEnvName

func SourceEnvName(envVarName string) sdk.ImportSource

func SourceEnvVars

func SourceEnvVars(envVars ...string) sdk.ImportSource

func SourceFile

func SourceFile(filename string) sdk.ImportSource

func SourceOther

func SourceOther(sourceType string, sourceValue string) sdk.ImportSource

func TryAll

func TryAll(importers ...sdk.Importer) sdk.Importer

func TryAllEnvVars

func TryAllEnvVars(fieldName sdk.FieldName, possibleEnvVarNames ...string) sdk.Importer

TryAllEnvVars tries the specified environment variables one by one and adds import candidates with the specified field for each environment variable that is set.

func TryEnvVarPair

func TryEnvVarPair(pairPossibilities map[string]sdk.FieldName) sdk.Importer

TryEnvVarPair tries the specified environment variables and adds an import candidate if at least one environment variable is set.

func TryFile

func TryFile(path string, result func(ctx context.Context, contents FileContents, in sdk.ImportInput, out *sdk.ImportAttempt)) sdk.Importer

Types

type FileContents

type FileContents []byte

func (FileContents) ToINI

func (fc FileContents) ToINI() (*ini.File, error)

func (FileContents) ToJSON

func (fc FileContents) ToJSON(result any) error

func (FileContents) ToString

func (fc FileContents) ToString() string

func (FileContents) ToTOML

func (fc FileContents) ToTOML(result any) error

func (FileContents) ToXML

func (fc FileContents) ToXML(result any) error

func (FileContents) ToYAML

func (fc FileContents) ToYAML(result any) error

Jump to

Keyboard shortcuts

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