models

package
v0.0.0-...-5776ade Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type I18nData

type I18nData struct {
	Stable    string `json:"stable"`
	StableKF5 string `json:"stableKF5"`
	Trunk     string `json:"trunk"`
	TrunkKF5  string `json:"trunkKF5"`

	// Custom fields not found in input data. Calculated by us.
	Component string `json:"component"`
}

I18nData represents I18n relevant data.

func (*I18nData) Infer

func (i *I18nData) Infer(project *Project)

Infer infers additional properties of I18nData from its Project.

func (*I18nData) Merge

func (i *I18nData) Merge(o I18nData)

Merge merges another i18nData into this i18nData. The other's values always override unless they are empty.

func (*I18nData) UnmarshalJSON

func (i *I18nData) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the input snake_case attributes into our struct which will marshal to CamelCase upon output via encoding tags.

type Project

type Project struct {
	I18n       I18nData `yaml:"i18n" json:"i18n"`
	Path       string   `yaml:"projectpath" json:"path"`
	Repo       string   `yaml:"repopath" json:"repo"`
	Active     bool     `yaml:"repoactive" json:"-"` // do not marshal to json, we presently have no use case for it
	Identifier string   `yaml:"identifier" json:"-"` // marshal'd via I18nData
}

Project is the core model of a project entity.

type ProjectFilter

type ProjectFilter struct {
	ID           string `form:"id"`       // basename of project path
	RepoPath     string `form:"repo"`     // complete repo path
	ActiveOnly   bool   `form:"active"`   // whether to select active projects
	InactiveOnly bool   `form:"inactive"` // whether to select inactive projects
}

ProjectFilter is used to filter projects on find() calls. The type(names) in this struct must be chosen so that an uninitialized filter results in match-all behavior!

Jump to

Keyboard shortcuts

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