pak

package
v0.0.0-...-45e9846 Latest Latest
Warning

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

Go to latest
Published: May 28, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Name        string   `json:"name"`
	Version     string   `json:"version"`
	URL         string   `json:"url"`
	Description string   `json:"description,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Icon        string   `json:"icon,omitempty"`
}

Info contains basic information about the pak that doesn't need to be fetched

func (*Info) String

func (p *Info) String() string

type InstalledPak

type InstalledPak struct {
	Group            string
	Namespace        string
	PakURL           string
	PropertiesValues map[string]interface{}
	Objects          []*kubectl.Object

	// Map of pod's name and its status
	Statuses map[string]*kubectl.PodStatus
}

InstalledPak Represents an installed pak with a unique Group

type Pak

type Pak struct {
	Info         `json:",inline"`
	Properties   []Property `json:"properties,omitempty"`
	ResourceURLs []string   `json:"resources"`

	// Populated from resources
	Templates []*template.Template `json:"-"`
}

Pak contains all the data and information that needed for installing it

func FromURL

func FromURL(url string) (*Pak, error)

FromURL reads a pak.yaml file and fetches all the resources files

func (*Pak) AddDefaultValues

func (p *Pak) AddDefaultValues(values map[string]interface{}) error

AddDefaultValues add default values for properties that not exists in values

func (*Pak) ExecuteTemplates

func (p *Pak) ExecuteTemplates(values map[string]interface{}) ([][]byte, error)

ExecuteTemplates generate resources of a pak with given values

func (*Pak) ID

func (p *Pak) ID() string

ID returns unique id for this pak

func (*Pak) ValidateValues

func (p *Pak) ValidateValues(values map[string]interface{}) error

ValidateValues validates given values with corresponding properties given values should be contain defaults - use MergeValuesWithDefaults before passing values to this function

type Property

type Property struct {
	Name        string      `json:"name"`
	Type        string      `json:"type"`
	Description string      `json:"description,omitempty"`
	Default     interface{} `json:"default,omitempty"`
}

Property contains definition of every property that required for generating pak templates

type Repo

type Repo struct {
	URL         string  `json:""`
	Name        string  `json:"name"`
	Description string  `json:"description,omitempty"`
	Maintainer  string  `json:"maintainer,omitempty"`
	Paks        []*Info `json:"packages"`
}

Repo represents an index file that contains list of paks

func RepoFromBytes

func RepoFromBytes(data []byte) (*Repo, error)

RepoFromBytes make *Repo from data

func RepoFromURL

func RepoFromURL(repoURL string) (*Repo, error)

RepoFromURL fetches index file specified by url and returns a *Repo

func (*Repo) Has

func (r *Repo) Has(pak string) bool

Has checks if repo contains the pak

func (*Repo) HasVersion

func (r *Repo) HasVersion(pak string, version string) bool

HasVersion checks if repo contains the pak with specific version

func (*Repo) Pak

func (r *Repo) Pak(pak string, version string) (*Pak, error)

Pak finds a pak with specified version and returns it

Jump to

Keyboard shortcuts

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