cncf

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LandscapeURL = "https://raw.githubusercontent.com/cncf/landscape/master/landscape.yml"
	CacheTTL     = 1 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

type Category

type Category struct {
	Name          string        `yaml:"name"`
	Subcategories []Subcategory `yaml:"subcategories"`
}

type DefaultHTTPClient

type DefaultHTTPClient struct{}

DefaultHTTPClient is the default implementation of HTTPClient that uses http.Get.

func (*DefaultHTTPClient) Get

func (c *DefaultHTTPClient) Get(rawURL string) (*http.Response, error)

type FindProjectOptions

type FindProjectOptions struct {
	RepoURL     string
	HomepageURL string
	Name        string
}

type HTTPClient

type HTTPClient interface {
	Get(url string) (*http.Response, error)
}

HTTPClient is an interface that abstracts the http.Get function.

type Landscape

type Landscape struct {
	Categories []Category `yaml:"landscape"`
}

func GetLandscape

func GetLandscape(client HTTPClient) (*Landscape, error)

func (*Landscape) FindProject

func (l *Landscape) FindProject(opts FindProjectOptions) *Project

FindProject finds a project in the landscape by repo URL, homepage URL, or name.

type Project

type Project struct {
	Name        string `yaml:"name"`
	HomepageURL string `yaml:"homepage_url"`
	RepoURL     string `yaml:"repo_url"`
	Project     string `yaml:"project"`
}

type Subcategory

type Subcategory struct {
	Name  string    `yaml:"name"`
	Items []Project `yaml:"items"`
}

Jump to

Keyboard shortcuts

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