loaders

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

The loaders package implements loading of raw kubernetes manifests based off of the CommonSpec of an Addon object.

Index

Constants

This section is empty.

Variables

View Source
var FlagChannel = "./channels"

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Manifests []Version `json:"manifests,omitempty"`
}

func (*Channel) Latest

func (c *Channel) Latest(packageName string) (*Version, error)

type FSRepository

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

FSRepository is a Repository backed by a filesystem

func NewFSRepository

func NewFSRepository(basedir string) *FSRepository

NewFSRepository is the constructor for an FSRepository

func (*FSRepository) LoadChannel

func (r *FSRepository) LoadChannel(ctx context.Context, name string) (*Channel, error)

func (*FSRepository) LoadManifest

func (r *FSRepository) LoadManifest(ctx context.Context, packageName string, id string) (map[string]string, error)

type GitRepository

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

func NewGitRepository

func NewGitRepository(baseurl string) *GitRepository

NewGitRepository constructs an GitRepository

func (*GitRepository) LoadChannel

func (r *GitRepository) LoadChannel(ctx context.Context, name string) (*Channel, error)

func (*GitRepository) LoadManifest

func (r *GitRepository) LoadManifest(ctx context.Context, packageName string, id string) (map[string]string, error)

type HTTPRepository

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

HTTPRepository supports loading from http / https

func NewHTTPRepository

func NewHTTPRepository(baseURL string) *HTTPRepository

NewHTTPRepository constructs an HTTPRepository

func (*HTTPRepository) LoadChannel

func (r *HTTPRepository) LoadChannel(ctx context.Context, name string) (*Channel, error)

func (*HTTPRepository) LoadManifest

func (r *HTTPRepository) LoadManifest(ctx context.Context, packageName string, id string) (map[string]string, error)

type ManifestLoader

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

func NewManifestLoader

func NewManifestLoader(channel string) (*ManifestLoader, error)

NewManifestLoader provides a Repository that resolves versions based on an Addon object and loads manifests from the filesystem.

func (*ManifestLoader) ResolveManifest

func (c *ManifestLoader) ResolveManifest(ctx context.Context, object runtime.Object) (map[string]string, error)

type Repository

type Repository interface {
	LoadChannel(ctx context.Context, name string) (*Channel, error)
	LoadManifest(ctx context.Context, packageName string, id string) (map[string]string, error)
}

type Version

type Version struct {
	Package string `json:"name"`
	Version string `json:"version"`
}

func (*Version) Compare

func (l *Version) Compare(r *Version) int

Compare compares two Versions, returning >0 for l>r, =0 if l=r, <0 if l<r

Jump to

Keyboard shortcuts

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