model

package
Version: v0.0.0-...-0a3a519 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCatalog

func DeleteCatalog(db *gorm.DB, environmentId, name string)

TODO: return error

Types

type Base

type Base struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
}

type Bindings

type Bindings struct {
	Labels map[string]string `json:"labels"`
	Ports  []string          `json:"ports"`
}

type Catalog

type Catalog struct {
	Name          string `json:"name"`
	URL           string `json:"url"`
	Branch        string `json:"branch"`
	Commit        string `json:"commit"`
	EnvironmentId string `json:"environmentId"`
}

func LookupCatalog

func LookupCatalog(db *gorm.DB, environmentId, name string) *Catalog

func LookupCatalogs

func LookupCatalogs(db *gorm.DB, environmentId string) []Catalog

type CatalogCollection

type CatalogCollection struct {
	client.Collection
	Data []CatalogResource `json:"data,omitempty"`
}

type CatalogError

type CatalogError struct {
	client.Resource
	Status  string `json:"status"`
	Message string `json:"message"`
}

type CatalogModel

type CatalogModel struct {
	Base
	Catalog
}

type CatalogResource

type CatalogResource struct {
	client.Resource
	Catalog
}

type File

type File struct {
	Catalog       string `json:"catalogId"`
	EnvironmentId string `json:"environmentId"`
	Name          string `json:"name"`
	Contents      string
	VersionID     uint
}

func LookupFiles

func LookupFiles(db *gorm.DB, catalog, environmentId string, versionId uint) []File

type FileModel

type FileModel struct {
	Base
	File
}

type Question

type Question struct {
	Variable     string   `json:"variable" yaml:"variable,omitempty"`
	Label        string   `json:"label" yaml:"label,omitempty"`
	Description  string   `json:"description" yaml:"description,omitempty"`
	Type         string   `json:"type" yaml:"type,omitempty"`
	Required     bool     `json:"required" yaml:"required,omitempty"`
	Default      string   `json:"default" yaml:"default,omitempty"`
	Group        string   `json:"group" yaml:"group,omitempty"`
	MinLength    int      `json:"minLength" yaml:"min_length,omitempty"`
	MaxLength    int      `json:"maxLength" yaml:"max_length,omitempty"`
	Min          int      `json:"min" yaml:"min,omitempty"`
	Max          int      `json:"max" yaml:"max,omitempty"`
	Options      []string `json:"options" yaml:"options,omitempty"`
	ValidChars   string   `json:"validChars" yaml:"valid_chars,omitempty"`
	InvalidChars string   `json:"invalidChars" yaml:"invalid_chars,omitempty"`
}

type RancherCompose

type RancherCompose struct {
	Name                  string     `yaml:"name"`
	UUID                  string     `yaml:"uuid"`
	Description           string     `yaml:"description"`
	Version               string     `yaml:"version"`
	Questions             []Question `json:"questions" yaml:"questions,omitempty"`
	MinimumRancherVersion string     `json:"minimumRancherVersion" yaml:"minimum_rancher_version,omitempty"`
	MaximumRancherVersion string     `json:"maximumRancherVersion" yaml:"maximum_rancher_version,omitempty"`
	//Output                Output            `json:"output" yaml:"output,omitempty"`
	Labels      map[string]string `json:"labels" yaml:"labels,omitempty"`
	UpgradeFrom string            `json:"upgradeFrom" yaml:"upgrade_from,omitempty"`
}

type Template

type Template struct {
	Name           string `json:"name"`
	Category       string `json:"category"`
	IsSystem       string `json:"isSystem"`
	Description    string `json:"description"`
	DefaultVersion string `json:"defaultVersion" yaml:"version"`
	Path           string `json:"path"`
	Maintainer     string `json:"maintainer"`
	License        string `json:"license"`
	ProjectURL     string `json:"projectURL"`
	//Labels                map[string]string      `json:"labels"`
	UpgradeFrom string `json:"upgradeFrom"`

	// TODO
	FolderName    string `json:"folderName"`
	Catalog       string `json:"catalogId"`
	EnvironmentId string `json:"environmentId"`
	//Prefix        string `json:"prefix"`
	Base         string `json:"templateBase"`
	Icon         []byte `json:"icon"`
	IconFilename string `json:"iconFilename"`
}

func LookupTemplate

func LookupTemplate(db *gorm.DB, environmentId, catalog, folderName, base string) *Template

func LookupTemplates

func LookupTemplates(db *gorm.DB, environmentId, catalog, category string) []Template

type TemplateCollection

type TemplateCollection struct {
	client.Collection
	Data []TemplateResource `json:"data,omitempty"`
}

type TemplateModel

type TemplateModel struct {
	Base
	Template
}

type TemplateResource

type TemplateResource struct {
	client.Resource
	Template

	VersionLinks map[string]string `json:"versionLinks"`
}

type TemplateVersionResource

type TemplateVersionResource struct {
	client.Resource
	Version

	Bindings            map[string]Bindings `json:"bindings"`
	Files               map[string]string   `json:"files"`
	Questions           []Question          `json:"questions"`
	UpgradeVersionLinks map[string]string   `json:"upgradeVersionLinks"`
}

type Version

type Version struct {
	Catalog               string `json:"catalogId"`
	EnvironmentId         string `json:"environmentId"`
	Template              string `json:"template"`
	Revision              int    `json:"revision"`
	Version               string `json:"version"`
	MinimumRancherVersion string `json:"minimumRancherVersion" yaml:"minimum_rancher_version"`
	MaximumRancherVersion string `json:"maximumRancherVersion" yaml:"maximum_rancher_version"`
	UpgradeFrom           string `json:"upgradeFrom" yaml:"upgrade_from"`

	// TODO move to model
	Files     []File
	Questions []Question
	Readme    string `json:"readme"`
}

TODO: might need a Base field for filtering TODO: might need a FolderName field for filtering

func LookupVersions

func LookupVersions(db *gorm.DB, environmentId, catalog, template string) []Version

type VersionModel

type VersionModel struct {
	Base
	Version
}

func LookupVersionModel

func LookupVersionModel(db *gorm.DB, environmentId, catalog, template string, revision int) *VersionModel

TODO: needs a base filter (make sure to use a map)

Jump to

Keyboard shortcuts

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