models

package
v0.0.0-...-74f3d50 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AnsibleIcon   = "/apps/frontend-assets/console-landing/ansible.svg"
	OpenShiftIcon = "/apps/frontend-assets/console-landing/openshift.svg"
	RHELIcon      = "/apps/frontend-assets/learning-resources/RHEL-icon.svg"
	RedHatIcon    = "/apps/frontend-assets/learning-resources/RH-icon.svg"

	FrontendFilters FilterData = FilterData{
		Categories: []FiltersCategory{
			{
				CategoryName: "Product families",
				CategoryID:   "product-families",
				CategoryData: []CategoryGroup{{
					Group: "Platforms",
					Data: []FilterItem{
						{Id: "ansible", CardLabel: "Ansible", FilterLabel: "Ansible", Icon: AnsibleIcon},
						{Id: "openshift", CardLabel: "OpenShift", FilterLabel: "OpenShift", Icon: OpenShiftIcon},
						{Id: "rhel", CardLabel: "RHEL", FilterLabel: "RHEL (Red Hat Enterprise Linux)", Icon: RHELIcon},
					},
				},
					{
						Group: "Console-wide services",
						Data: []FilterItem{
							{Id: "iam", CardLabel: "IAM", FilterLabel: "IAM (Identity and Access Management)", Icon: RedHatIcon},
							{Id: "settings", CardLabel: "Settings", FilterLabel: "Settings", Icon: RedHatIcon},
							{Id: "subscriptions-services", CardLabel: "Subscriptions services", FilterLabel: "Subscriptions services", Icon: RedHatIcon},
						},
					},
				},
			},
			{
				CategoryName: "Content type",
				CategoryID:   "content",
				CategoryData: []CategoryGroup{{
					Data: []FilterItem{
						{Id: "documentation", CardLabel: "Documentation", FilterLabel: "Documentation", Color: "orange"},
						{Id: "learningPath", CardLabel: "Learning path", FilterLabel: "Learning paths", Color: "cyan"},
						{Id: "quickstart", CardLabel: "Quick start", FilterLabel: "Quick start", Color: "green"},
						{Id: "otherResource", CardLabel: "Other", FilterLabel: "Other content types", Color: "purple"},
					},
				}},
			},
			{
				CategoryName: "Use case",
				CategoryID:   "use-case",
				CategoryData: []CategoryGroup{{
					Data: []FilterItem{
						{Id: "automation", CardLabel: "Automation", FilterLabel: "Automation"},
						{Id: "clusters", CardLabel: "Clusters", FilterLabel: "Clusters"},
						{Id: "containers", CardLabel: "Containers", FilterLabel: "Containers"},
						{Id: "data-services", CardLabel: "Data services", FilterLabel: "Data services"},
						{Id: "deploy", CardLabel: "Deploy", FilterLabel: "Deploy"},
						{Id: "identity-and-access", CardLabel: "Identity and access", FilterLabel: "Identity and access"},
						{Id: "images", CardLabel: "Images", FilterLabel: "Images"},
						{Id: "infrastructure", CardLabel: "Infrastructure", FilterLabel: "Infrastructure"},
						{Id: "observability", CardLabel: "Observability", FilterLabel: "Observability"},
						{Id: "security", CardLabel: "Security", FilterLabel: "Security"},
						{Id: "spend-management", CardLabel: "Spend management", FilterLabel: "Spend management"},
						{Id: "system-configuration", CardLabel: "System configuration", FilterLabel: "System configuration"},
					},
				}},
			},
		},
	}
)

Functions

This section is empty.

Types

type BadRequest

type BadRequest struct {
	Msg string `json:"msg"`
}

type BaseModel

type BaseModel struct {
	ID        uint           `gorm:"primarykey" json:"id,omitempty"`
	CreatedAt time.Time      `json:"createdAt,omitempty"`
	UpdatedAt time.Time      `json:"updatedAt,omitempty"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt,omitempty"`
}

BaseModel is a basic struc based on gorm.Model with added json attribues for openAPI3 generator

type CategoryGroup

type CategoryGroup struct {
	Group string       `json:"group,omitempty"`
	Data  []FilterItem `json:"data"`
}

type ContentJson

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

type FavoriteQuickstart

type FavoriteQuickstart struct {
	BaseModel
	AccountId      string `gorm:"not null;" json:"accountId"`
	QuickstartName string `gorm:"not null;" json:"quickstartName"`
	Favorite       bool   `json:"favorite"`
}

type FilterData

type FilterData struct {
	Categories []FiltersCategory `json:"categories"`
}

type FilterItem

type FilterItem struct {
	Id          string `json:"id"`
	FilterLabel string `json:"filterLabel"`
	CardLabel   string `json:"cardLabel,omitempty"`
	Color       string `json:"color,omitempty"`
	Icon        string `json:"icon,omitempty"`
}

type FiltersCategory

type FiltersCategory struct {
	CategoryName string          `json:"categoryName"`
	CategoryID   string          `json:"categoryId"`
	CategoryData []CategoryGroup `json:"categoryData"`
}

type HelpTopic

type HelpTopic struct {
	BaseModel
	GroupName string         `json:"groupName"`
	Name      string         `gorm:"unique;not null;default:null" json:"name"`
	Content   datatypes.JSON `gorm:"type: JSONB" json:"content,omitempty"`
	Tags      []Tag          `gorm:"many2many:help_topic_tags;" json:"tags,omitempty"`
}

HelpTopic represents the help topic json content

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

type NotFound

type NotFound struct {
	Msg string `json:"msg"`
}

type Quickstart

type Quickstart struct {
	BaseModel
	Name               string               `gorm:"unique;not null;default:null" json:"name"`
	Content            datatypes.JSON       `gorm:"type: JSONB" json:"content,omitempty"`
	Tags               []Tag                `gorm:"many2many:quickstart_tags;" json:"tags,omitempty"`
	FavoriteQuickstart []FavoriteQuickstart `gorm:"foreignKey:QuickstartName;references:Name" json:"favoriteQuickstart"`
}

Quickstart represents the quickstart json content

type QuickstartProgress

type QuickstartProgress struct {
	gorm.Model
	QuickstartName string          `gorm:"index:progress_session,unique;default:empty" json:"quickstartName,omitempty"`
	Progress       *datatypes.JSON `json:"progress,omitempty" gorm:"type: JSONB"`
	AccountId      int             `gorm:"index:progress_session,unique;default:0" json:"accountId,omitempty"`
}

type Tag

type Tag struct {
	BaseModel
	Type        TagType      `json:"type" sql:"type:text" gorm:"not null"`
	Value       string       `json:"value" gorm:"not null;default:null"`
	Quickstarts []Quickstart `gorm:"many2many:quickstart_tags;"`
	HelpTopics  []HelpTopic  `gorm:"many2many:help_topic_tags;"`
}

Tag is used for additional entity filtrations

type TagType

type TagType string
const (
	BundleTag       TagType = "bundle"
	ApplicationTag  TagType = "application"
	ContentKind     TagType = "kind"
	TopicTag        TagType = "topic"
	ContentType     TagType = "content"
	ProductFamilies TagType = "product-families"
	UseCase         TagType = "use-case"
)

func (TagType) GetAllTags

func (t TagType) GetAllTags() []TagType

func (TagType) IsValidTag

func (t TagType) IsValidTag() bool

func (*TagType) Scan

func (t *TagType) Scan(value interface{}) error

func (TagType) Value

func (t TagType) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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