fallbacks

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package fallbacks provides functionality for managing tool fallback sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compact added in v0.1.0

func Compact[T comparable](s []T) []T

Compact removes duplicate elements from a slice while preserving order.

Types

type Fallbacks

type Fallbacks []sources.Type

Fallbacks represents a collection of fallback sources for the tool. It can either be a single source type or a slice of source types, allowing flexibility in specifying multiple fallback methods if the primary source fails.

func (Fallbacks) Build

func (f Fallbacks) Build(sourceType sources.Type) []sources.Type

Build creates a source type list by prepending the given type to fallbacks.

func (Fallbacks) Compacted

func (f Fallbacks) Compacted() Fallbacks

Compacted returns a new Fallbacks slice with duplicates removed.

func (*Fallbacks) UnmarshalYAML

func (f *Fallbacks) UnmarshalYAML(node ast.Node) (err error)

UnmarshalYAML implements custom unmarshaling for Tags, allowing the field to be either a single string or a list of strings.

Jump to

Keyboard shortcuts

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