source

package
v0.0.0-...-bdef6d6 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSourceFileNotFound = errors.New("source file not found")
)

Functions

This section is empty.

Types

type Cacheable

type Cacheable interface {
	CacheKey() string
}

Cacheable indicates that a given config can be cached by the returned key. This allows duplicate configurations to only fetch latest versions once.

type Config

type Config struct {
	Filename string `yaml:"-"`
	Source   Source `yaml:"source"`
}

Config is the source config.

func GatherConfigs

func GatherConfigs(root string) ([]*Config, error)

func NewConfig

func NewConfig(reader io.Reader) (*Config, error)

NewConfig returns a new config.

func (Config) CacheKey

func (c Config) CacheKey() string

type CratesConfig

type CratesConfig struct {
	CrateName string `yaml:"crate_name"`
}

CratesConfig is the crates.io API configuration.

func (CratesConfig) CacheKey

func (c CratesConfig) CacheKey() string

type DartFlutterConfig

type DartFlutterConfig struct {
	Name string `yaml:"name"`
}

DartFlutterConfig is the dart and flutter configuration.

func (DartFlutterConfig) CacheKey

func (d DartFlutterConfig) CacheKey() string

type GitHubConfig

type GitHubConfig struct {
	Owner      string `yaml:"owner"`
	Repository string `yaml:"repository"`
}

GitHubConfig is the GitHub configuration.

func (GitHubConfig) CacheKey

func (g GitHubConfig) CacheKey() string

type GoProxyConfig

type GoProxyConfig struct {
	Name string `yaml:"name"`
}

GoProxyConfig is the go proxy configuration.

func (GoProxyConfig) CacheKey

func (g GoProxyConfig) CacheKey() string

type MavenConfig

type MavenConfig struct {
	Group string `yaml:"group"`
	Name  string `yaml:"name"`
}

MavenConfig is the maven search configuration.

func (MavenConfig) CacheKey

func (m MavenConfig) CacheKey() string

type NPMRegistryConfig

type NPMRegistryConfig struct {
	Name string `yaml:"name"`
}

NPMRegistryConfig is the npm registry configuration.

func (NPMRegistryConfig) CacheKey

func (n NPMRegistryConfig) CacheKey() string

type Source

type Source struct {
	Disabled bool `yaml:"disabled"`
	// Only one field will be set.
	GitHub      *GitHubConfig      `yaml:"github"`
	DartFlutter *DartFlutterConfig `yaml:"dart_flutter"`
	GoProxy     *GoProxyConfig     `yaml:"goproxy"`
	NPMRegistry *NPMRegistryConfig `yaml:"npm_registry"`
	Maven       *MavenConfig       `yaml:"maven"`
	Crates      *CratesConfig      `yaml:"crates"`
}

Source is the configuration for the fetch source.

func (*Source) CacheKey

func (s *Source) CacheKey() string

func (*Source) Name

func (s *Source) Name() string

Jump to

Keyboard shortcuts

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