model

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2017 License: Apache-2.0 Imports: 6 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
}

type Bindings

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

type Catalog

type Catalog struct {
	EnvironmentId string `json:"environmentId"`

	Name   string `json:"name"`
	URL    string `json:"url"`
	Branch string `json:"branch"`
	Commit string `json:"commit"`
	Type   string `json:"type"`
	Kind   string `json:"kind"`
}

func GetCatalog

func GetCatalog(db *gorm.DB, id uint) *Catalog

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 Category

type Category struct {
	Name string
}

type CategoryAndTemplate added in v0.18.0

type CategoryAndTemplate struct {
	TemplateID int
	CategoryID int
	Category
}

type CategoryModel

type CategoryModel struct {
	Base
	Category
}

type File

type File struct {
	VersionId uint `sql:"type:integer REFERENCES catalog_version(id) ON DELETE CASCADE"`

	Name     string `json:"name"`
	Contents string
}

type FileModel

type FileModel struct {
	Base
	File
}

type LabelAndTemplate added in v0.18.0

type LabelAndTemplate struct {
	TemplateID string
	Key        string
	Value      string
}

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"`
	Labels                map[string]string `json:"labels" yaml:"labels,omitempty"`
	UpgradeFrom           string            `json:"upgradeFrom" yaml:"upgrade_from,omitempty"`
}

type Template

type Template struct {
	EnvironmentId string `json:"environmentId"`
	CatalogId     uint   `sql:"type:integer REFERENCES catalog(id) ON DELETE CASCADE"`

	Name           string `json:"name"`
	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" yaml:"projectURL"`
	UpgradeFrom    string `json:"upgradeFrom"`
	FolderName     string `json:"folderName"`
	Catalog        string `json:"catalogId"`
	Base           string `json:"templateBase"`
	Icon           string `json:"icon"`
	IconFilename   string `json:"iconFilename"`
	Readme         string `json:"readme"`

	Categories []string          `sql:"-" json:"categories"`
	Labels     map[string]string `sql:"-" json:"labels"`

	Versions []Version `sql:"-"`
	Category string    `sql:"-"`
}

func LookupTemplate

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

func LookupTemplates

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

type TemplateCategory

type TemplateCategory struct {
	TemplateId uint `sql:"type:integer REFERENCES catalog_template(id) ON DELETE CASCADE"`
	CategoryId uint `sql:"type:integer REFERENCES catalog_category(id) ON DELETE CASCADE"`
}

type TemplateCategoryModel

type TemplateCategoryModel struct {
	Base
	TemplateCategory
}

type TemplateCollection

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

type TemplateLabel added in v0.16.3

type TemplateLabel struct {
	TemplateId uint `sql:"type:integer REFERENCES catalog_template(id) ON DELETE CASCADE"`

	Key   string
	Value string
}

type TemplateLabelModel added in v0.16.3

type TemplateLabelModel struct {
	Base
	TemplateLabel
}

type TemplateModel

type TemplateModel struct {
	Base
	Template
}

type TemplateResource

type TemplateResource struct {
	client.Resource
	Template

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

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"`
	TemplateId          string              `json:"templateId"`
}

type Version

type Version struct {
	TemplateId uint `sql:"type:integer REFERENCES catalog_template(id) ON DELETE CASCADE"`

	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"`
	Readme                string `json:"readme"`

	Labels map[string]string `sql:"-" json:"labels"`

	Files     []File     `sql:"-"`
	Questions []Question `sql:"-"`
}

func LookupVersionByRevision added in v0.17.0

func LookupVersionByRevision(db *gorm.DB, environmentId, catalog, base, template string, revision int) *Version

func LookupVersionByVersion added in v0.17.0

func LookupVersionByVersion(db *gorm.DB, environmentId, catalog, base, template string, version string) *Version

type VersionLabel added in v0.16.3

type VersionLabel struct {
	VersionId uint `sql:"type:integer REFERENCES catalog_version(id) ON DELETE CASCADE"`

	Key   string
	Value string
}

type VersionLabelModel added in v0.16.3

type VersionLabelModel struct {
	Base
	VersionLabel
}

type VersionModel

type VersionModel struct {
	Base
	Version
}

Jump to

Keyboard shortcuts

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