Documentation ¶
Index ¶
- func LinuxOnly(importers ...sdk.Importer) sdk.Importer
- func MacOnly(importers ...sdk.Importer) sdk.Importer
- func NoOp() sdk.Importer
- func SanitizeNameHint(nameHint string) string
- func SourceEnvName(envVarName string) sdk.ImportSource
- func SourceEnvVars(envVars ...string) sdk.ImportSource
- func SourceFile(filename string) sdk.ImportSource
- func SourceOther(sourceType string, sourceValue string) sdk.ImportSource
- func TryAll(importers ...sdk.Importer) sdk.Importer
- func TryAllEnvVars(fieldName sdk.FieldName, possibleEnvVarNames ...string) sdk.Importer
- func TryEnvVarPair(pairPossibilities map[string]sdk.FieldName) sdk.Importer
- func TryFile(path string, ...) sdk.Importer
- type FileContents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeNameHint ¶
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 TryAllEnvVars ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.