managedschemas

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Code generated for package managedschemas by build.sh DO NOT EDIT. (@generated)

Code generated for package managedschemas by go-bindata DO NOT EDIT. (@generated) sources: ../../../../../../../tmp/tmp.ZllJp6rMjX/dist/managed-schemas/manifest.yml

Index

Constants

View Source
const ReleaseVersion = "v0.0.0-test"

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func DownloadFile

func DownloadFile(ctx context.Context, client HTTPClient, url string) ([]byte, error)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type GitHubRepository

type GitHubRepository struct {
	Repo   string
	Owner  string
	Client *github.Client
}

GitHubRepository fetches release feeds using GitHub Releases API

func (*GitHubRepository) ReleaseFeed

func (p *GitHubRepository) ReleaseFeed(ctx context.Context, sinceTag string) ([]Release, error)

ReleaseFeed implements ReleaseFeeder interface

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

type ManifestEntry

type ManifestEntry struct {
	Release string
	Name    string
	Spec    string
}

ManifestEntry describes a managed schema entry from a specific release

func LoadDefaultManifest

func LoadDefaultManifest() ([]ManifestEntry, error)

func LoadReleaseManifestFromURL

func LoadReleaseManifestFromURL(ctx context.Context, manifestURL string) ([]ManifestEntry, error)

LoadReleaseManifestFromURL fetches a release archive from a URL and reads manifest entries.

func MustLoadDefaultManifest

func MustLoadDefaultManifest() []ManifestEntry

func ReadYAMLManifest

func ReadYAMLManifest(release string, r io.Reader) ([]ManifestEntry, error)

ReadYAMLManifest reads entries from a `manifest.yml` file

type Release

type Release struct {
	Tag         string `json:"tag"`
	Description string `json:"description"`
	ManifestURL string `json:"manifestURL"`
}

Release describes a managed schema release

func (*Release) IsValid

func (r *Release) IsValid() bool

IsValid checks that a release has a valid version and points to a manifest file

type ReleaseFeed

type ReleaseFeed []Release

ReleaseFeed is a list of managed schema releases

func (ReleaseFeed) Len

func (f ReleaseFeed) Len() int

Len implements sort.Interface

func (ReleaseFeed) Less

func (f ReleaseFeed) Less(i, j int) bool

Less implements sort.Interface

func (ReleaseFeed) Swap

func (f ReleaseFeed) Swap(i, j int)

Swap implements sort.Interface

func (ReleaseFeed) Valid

func (f ReleaseFeed) Valid() ReleaseFeed

Valid filters a release feed keeping only valid entries

type ReleaseFeeder

type ReleaseFeeder interface {
	ReleaseFeed(ctx context.Context, sinceTag string) ([]Release, error)
}

ReleaseFeeder provides a feed of releases since a specific version tag

Jump to

Keyboard shortcuts

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