Documentation
¶
Index ¶
- Constants
- Variables
- func Validate(c *Content) error
- type About
- type AboutList
- func (s *AboutList) Append() model.Fielder
- func (s *AboutList) At(i int) model.Fielder
- func (s *AboutList) DecodeFields(_ model.FieldReader)
- func (s *AboutList) EncodeFields(_ model.FieldWriter)
- func (s *AboutList) IsNil() bool
- func (s *AboutList) Len() int
- func (s *AboutList) Pointers() []any
- func (s *AboutList) Schema() []model.Field
- type Brand
- type BrandList
- func (s *BrandList) Append() model.Fielder
- func (s *BrandList) At(i int) model.Fielder
- func (s *BrandList) DecodeFields(_ model.FieldReader)
- func (s *BrandList) EncodeFields(_ model.FieldWriter)
- func (s *BrandList) IsNil() bool
- func (s *BrandList) Len() int
- func (s *BrandList) Pointers() []any
- func (s *BrandList) Schema() []model.Field
- type Contact
- type ContactList
- func (s *ContactList) Append() model.Fielder
- func (s *ContactList) At(i int) model.Fielder
- func (s *ContactList) DecodeFields(_ model.FieldReader)
- func (s *ContactList) EncodeFields(_ model.FieldWriter)
- func (s *ContactList) IsNil() bool
- func (s *ContactList) Len() int
- func (s *ContactList) Pointers() []any
- func (s *ContactList) Schema() []model.Field
- type Content
- type ContentList
- func (s *ContentList) Append() model.Fielder
- func (s *ContentList) At(i int) model.Fielder
- func (s *ContentList) DecodeFields(_ model.FieldReader)
- func (s *ContentList) EncodeFields(_ model.FieldWriter)
- func (s *ContentList) IsNil() bool
- func (s *ContentList) Len() int
- func (s *ContentList) Pointers() []any
- func (s *ContentList) Schema() []model.Field
- type ContentRecord
- func (m *ContentRecord) DecodeFields(r model.FieldReader)
- func (m *ContentRecord) EncodeFields(w model.FieldWriter)
- func (m *ContentRecord) IsNil() bool
- func (m *ContentRecord) ModelName() string
- func (m *ContentRecord) Pointers() []any
- func (m *ContentRecord) Schema() []model.Field
- func (m *ContentRecord) Validate(action byte) error
- type Deps
- type Hero
- type HeroList
- func (s *HeroList) Append() model.Fielder
- func (s *HeroList) At(i int) model.Fielder
- func (s *HeroList) DecodeFields(_ model.FieldReader)
- func (s *HeroList) EncodeFields(_ model.FieldWriter)
- func (s *HeroList) IsNil() bool
- func (s *HeroList) Len() int
- func (s *HeroList) Pointers() []any
- func (s *HeroList) Schema() []model.Field
- type ImageItem
- func (m *ImageItem) DecodeFields(r model.FieldReader)
- func (m *ImageItem) EncodeFields(w model.FieldWriter)
- func (m *ImageItem) IsNil() bool
- func (m *ImageItem) ModelName() string
- func (m *ImageItem) Pointers() []any
- func (m *ImageItem) Schema() []model.Field
- func (m *ImageItem) Validate(action byte) error
- type ImageItemList
- func (s *ImageItemList) Append() model.Fielder
- func (s *ImageItemList) At(i int) model.Fielder
- func (s *ImageItemList) DecodeFields(_ model.FieldReader)
- func (s *ImageItemList) EncodeFields(_ model.FieldWriter)
- func (s *ImageItemList) IsNil() bool
- func (s *ImageItemList) Len() int
- func (s *ImageItemList) Pointers() []any
- func (s *ImageItemList) Schema() []model.Field
- type ImageRef
- func (m *ImageRef) DecodeFields(r model.FieldReader)
- func (m *ImageRef) EncodeFields(w model.FieldWriter)
- func (m *ImageRef) IsNil() bool
- func (m *ImageRef) ModelName() string
- func (m *ImageRef) Pointers() []any
- func (m *ImageRef) Schema() []model.Field
- func (m *ImageRef) Validate(action byte) error
- type ImageRefList
- func (s *ImageRefList) Append() model.Fielder
- func (s *ImageRefList) At(i int) model.Fielder
- func (s *ImageRefList) DecodeFields(_ model.FieldReader)
- func (s *ImageRefList) EncodeFields(_ model.FieldWriter)
- func (s *ImageRefList) IsNil() bool
- func (s *ImageRefList) Len() int
- func (s *ImageRefList) Pointers() []any
- func (s *ImageRefList) Schema() []model.Field
- type Link
- type LinkList
- func (s *LinkList) Append() model.Fielder
- func (s *LinkList) At(i int) model.Fielder
- func (s *LinkList) DecodeFields(_ model.FieldReader)
- func (s *LinkList) EncodeFields(_ model.FieldWriter)
- func (s *LinkList) IsNil() bool
- func (s *LinkList) Len() int
- func (s *LinkList) Pointers() []any
- func (s *LinkList) Schema() []model.Field
- type Map
- type MapList
- func (s *MapList) Append() model.Fielder
- func (s *MapList) At(i int) model.Fielder
- func (s *MapList) DecodeFields(_ model.FieldReader)
- func (s *MapList) EncodeFields(_ model.FieldWriter)
- func (s *MapList) IsNil() bool
- func (s *MapList) Len() int
- func (s *MapList) Pointers() []any
- func (s *MapList) Schema() []model.Field
- type MemoryCodec
- type Module
- type SEO
- type SEOList
- func (s *SEOList) Append() model.Fielder
- func (s *SEOList) At(i int) model.Fielder
- func (s *SEOList) DecodeFields(_ model.FieldReader)
- func (s *SEOList) EncodeFields(_ model.FieldWriter)
- func (s *SEOList) IsNil() bool
- func (s *SEOList) Len() int
- func (s *SEOList) Pointers() []any
- func (s *SEOList) Schema() []model.Field
- type Schedule
- func (m *Schedule) DecodeFields(r model.FieldReader)
- func (m *Schedule) EncodeFields(w model.FieldWriter)
- func (m *Schedule) IsNil() bool
- func (m *Schedule) ModelName() string
- func (m *Schedule) Pointers() []any
- func (m *Schedule) Schema() []model.Field
- func (m *Schedule) Validate(action byte) error
- type ScheduleList
- func (s *ScheduleList) Append() model.Fielder
- func (s *ScheduleList) At(i int) model.Fielder
- func (s *ScheduleList) DecodeFields(_ model.FieldReader)
- func (s *ScheduleList) EncodeFields(_ model.FieldWriter)
- func (s *ScheduleList) IsNil() bool
- func (s *ScheduleList) Len() int
- func (s *ScheduleList) Pointers() []any
- func (s *ScheduleList) Schema() []model.Field
- type Service
- type ServiceList
- func (s *ServiceList) Append() model.Fielder
- func (s *ServiceList) At(i int) model.Fielder
- func (s *ServiceList) DecodeFields(_ model.FieldReader)
- func (s *ServiceList) EncodeFields(_ model.FieldWriter)
- func (s *ServiceList) IsNil() bool
- func (s *ServiceList) Len() int
- func (s *ServiceList) Pointers() []any
- func (s *ServiceList) Schema() []model.Field
- type Stat
- type StatList
- func (s *StatList) Append() model.Fielder
- func (s *StatList) At(i int) model.Fielder
- func (s *StatList) DecodeFields(_ model.FieldReader)
- func (s *StatList) EncodeFields(_ model.FieldWriter)
- func (s *StatList) IsNil() bool
- func (s *StatList) Len() int
- func (s *StatList) Pointers() []any
- func (s *StatList) Schema() []model.Field
Constants ¶
View Source
const ( ErrRequired = "required" ErrInvalidSlug = "site_content: slug invalido %q: solo minusculas, numeros y guiones" ErrDuplicateAttr = "site_content: dos servicios comparten %s: %q" ErrInvalidColor = "site_content: color primario invalido: debe ser #rrggbb" )
Variables ¶
View Source
var AboutModel = model.Definition{ Name: "about", Fields: model.Fields{ {Name: "Title", Type: model.Text()}, {Name: "Body", Type: model.Text()}, {Name: "Image", Type: model.Text()}, {Name: "Mission", Type: model.Text()}, {Name: "Vision", Type: model.Text()}, }, }
View Source
var BrandModel = model.Definition{ Name: "brand", Fields: model.Fields{ {Name: "Name", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune("=;{}[].,#_:-")}}, {Name: "WideLogo", Type: model.Text()}, {Name: "CompactLogo", Type: model.Text()}, {Name: "LogoAlt", Type: model.Text()}, {Name: "PrimaryColor", Type: model.Text(), Permitted: model.Permitted{Letters: true, Numbers: true, Extra: []rune("#")}}, }, }
View Source
var ContactModel = model.Definition{ Name: "contact", Fields: model.Fields{ {Name: "Phone", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Numbers: true, Extra: []rune("+-() ")}}, {Name: "Email", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Extra: []rune("@._-")}}, {Name: "Address", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune(".,#-")}}, }, }
View Source
var ContentModel = model.Definition{ Name: "content", Fields: model.Fields{ {Name: "SiteID", Type: model.Text(), NotNull: true, DB: &model.FieldDB{PK: true}}, {Name: "Brand", Type: model.Struct(&BrandModel)}, {Name: "Contact", Type: model.Struct(&ContactModel)}, {Name: "Hero", Type: model.Struct(&HeroModel)}, {Name: "About", Type: model.Struct(&AboutModel)}, {Name: "Services", Type: model.StructSlice(&ServiceModel)}, {Name: "Stats", Type: model.StructSlice(&StatModel)}, {Name: "Hours", Type: model.StructSlice(&ScheduleModel)}, {Name: "Map", Type: model.Struct(&MapModel)}, {Name: "SEO", Type: model.Struct(&SEOModel)}, {Name: "Images", Type: model.StructSlice(&ImageRefModel)}, }, }
View Source
var Content_ = struct { SiteId string Brand string Contact string Hero string About string Services string Stats string Hours string Map string Seo string Images string }{ SiteId: "SiteID", Brand: "Brand", Contact: "Contact", Hero: "Hero", About: "About", Services: "Services", Stats: "Stats", Hours: "Hours", Map: "Map", Seo: "SEO", Images: "Images", }
View Source
var (
ErrNotFound = fmt.Err("site_content", "not found")
)
View Source
var HeroModel = model.Definition{ Name: "hero", Fields: model.Fields{ {Name: "Title", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune("=;{}[].,#_:-")}}, {Name: "Subtitle", Type: model.Text()}, {Name: "CTAs", Type: model.StructSlice(&LinkModel)}, {Name: "Images", Type: model.StructSlice(&ImageItemModel)}, }, }
View Source
var ImageItemModel = model.Definition{ Name: "image_item", Fields: model.Fields{ {Name: "Key", Type: model.Text()}, }, }
View Source
var ImageRefModel = model.Definition{ Name: "image_ref", Fields: model.Fields{ {Name: "Key", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Extra: []rune("-_/.")}}, {Name: "Alt", Type: model.Text(), NotNull: true}, {Name: "Usage", Type: model.Text()}, }, }
View Source
var LinkModel = model.Definition{ Name: "link", Fields: model.Fields{ {Name: "Text", Type: model.Text()}, {Name: "URL", Type: model.Text()}, }, }
View Source
var MapModel = model.Definition{ Name: "map", Fields: model.Fields{ {Name: "EmbedURL", Type: model.Text()}, }, }
View Source
var SEOModel = model.Definition{ Name: "seo", Fields: model.Fields{ {Name: "Description", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune("=;{}[].,#_:-")}}, {Name: "SocialImage", Type: model.Text()}, {Name: "SchemaType", Type: model.Text()}, }, }
View Source
var ScheduleModel = model.Definition{ Name: "schedule", Fields: model.Fields{ {Name: "Days", Type: model.Text()}, {Name: "Hours", Type: model.Text()}, }, }
View Source
var ServiceModel = model.Definition{ Name: "service", Fields: model.Fields{ {Name: "Slug", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Extra: []rune("-")}}, {Name: "Title", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune("=;{}[].,#_:-")}}, {Name: "Description", Type: model.Text(), NotNull: true, Permitted: model.Permitted{Letters: true, Numbers: true, Spaces: true, Extra: []rune("=;{}[].,#_:-")}}, {Name: "Image", Type: model.Text()}, {Name: "Body", Type: model.Text()}, }, }
View Source
var StatModel = model.Definition{ Name: "stat", Fields: model.Fields{ {Name: "Value", Type: model.Text()}, {Name: "Label", Type: model.Text()}, }, }
Functions ¶
Types ¶
type About ¶
func (*About) DecodeFields ¶
func (m *About) DecodeFields(r model.FieldReader)
func (*About) EncodeFields ¶
func (m *About) EncodeFields(w model.FieldWriter)
type AboutList ¶
type AboutList []*About
func (*AboutList) DecodeFields ¶
func (s *AboutList) DecodeFields(_ model.FieldReader)
func (*AboutList) EncodeFields ¶
func (s *AboutList) EncodeFields(_ model.FieldWriter)
type Brand ¶
type Brand struct {
Name string
WideLogo string
CompactLogo string
LogoAlt string
PrimaryColor string
}
func (*Brand) DecodeFields ¶
func (m *Brand) DecodeFields(r model.FieldReader)
func (*Brand) EncodeFields ¶
func (m *Brand) EncodeFields(w model.FieldWriter)
type BrandList ¶
type BrandList []*Brand
func (*BrandList) DecodeFields ¶
func (s *BrandList) DecodeFields(_ model.FieldReader)
func (*BrandList) EncodeFields ¶
func (s *BrandList) EncodeFields(_ model.FieldWriter)
type Contact ¶
func (*Contact) DecodeFields ¶
func (m *Contact) DecodeFields(r model.FieldReader)
func (*Contact) EncodeFields ¶
func (m *Contact) EncodeFields(w model.FieldWriter)
type ContactList ¶
type ContactList []*Contact
func (*ContactList) Append ¶
func (s *ContactList) Append() model.Fielder
func (*ContactList) DecodeFields ¶
func (s *ContactList) DecodeFields(_ model.FieldReader)
func (*ContactList) EncodeFields ¶
func (s *ContactList) EncodeFields(_ model.FieldWriter)
func (*ContactList) IsNil ¶
func (s *ContactList) IsNil() bool
func (*ContactList) Len ¶
func (s *ContactList) Len() int
func (*ContactList) Pointers ¶
func (s *ContactList) Pointers() []any
func (*ContactList) Schema ¶
func (s *ContactList) Schema() []model.Field
type Content ¶
type Content struct {
SiteId string
Brand Brand
Contact Contact
Hero Hero
About About
Services []Service
Stats []Stat
Hours []Schedule
Map Map
Seo SEO
Images []ImageRef
}
func (*Content) DecodeFields ¶
func (m *Content) DecodeFields(r model.FieldReader)
func (*Content) EncodeFields ¶
func (m *Content) EncodeFields(w model.FieldWriter)
type ContentList ¶
type ContentList []*Content
func ReadAllContent ¶
func ReadAllContent(qb *orm.QB) (ContentList, error)
func (*ContentList) Append ¶
func (s *ContentList) Append() model.Fielder
func (*ContentList) DecodeFields ¶
func (s *ContentList) DecodeFields(_ model.FieldReader)
func (*ContentList) EncodeFields ¶
func (s *ContentList) EncodeFields(_ model.FieldWriter)
func (*ContentList) IsNil ¶
func (s *ContentList) IsNil() bool
func (*ContentList) Len ¶
func (s *ContentList) Len() int
func (*ContentList) Pointers ¶
func (s *ContentList) Pointers() []any
func (*ContentList) Schema ¶
func (s *ContentList) Schema() []model.Field
type ContentRecord ¶
func (*ContentRecord) DecodeFields ¶
func (m *ContentRecord) DecodeFields(r model.FieldReader)
func (*ContentRecord) EncodeFields ¶
func (m *ContentRecord) EncodeFields(w model.FieldWriter)
func (*ContentRecord) IsNil ¶
func (m *ContentRecord) IsNil() bool
func (*ContentRecord) ModelName ¶
func (m *ContentRecord) ModelName() string
func (*ContentRecord) Pointers ¶
func (m *ContentRecord) Pointers() []any
func (*ContentRecord) Schema ¶
func (m *ContentRecord) Schema() []model.Field
func (*ContentRecord) Validate ¶
func (m *ContentRecord) Validate(action byte) error
type Hero ¶
func (*Hero) DecodeFields ¶
func (m *Hero) DecodeFields(r model.FieldReader)
func (*Hero) EncodeFields ¶
func (m *Hero) EncodeFields(w model.FieldWriter)
type HeroList ¶
type HeroList []*Hero
func (*HeroList) DecodeFields ¶
func (s *HeroList) DecodeFields(_ model.FieldReader)
func (*HeroList) EncodeFields ¶
func (s *HeroList) EncodeFields(_ model.FieldWriter)
type ImageItem ¶
type ImageItem struct {
Key string
}
func (*ImageItem) DecodeFields ¶
func (m *ImageItem) DecodeFields(r model.FieldReader)
func (*ImageItem) EncodeFields ¶
func (m *ImageItem) EncodeFields(w model.FieldWriter)
type ImageItemList ¶
type ImageItemList []*ImageItem
func (*ImageItemList) Append ¶
func (s *ImageItemList) Append() model.Fielder
func (*ImageItemList) DecodeFields ¶
func (s *ImageItemList) DecodeFields(_ model.FieldReader)
func (*ImageItemList) EncodeFields ¶
func (s *ImageItemList) EncodeFields(_ model.FieldWriter)
func (*ImageItemList) IsNil ¶
func (s *ImageItemList) IsNil() bool
func (*ImageItemList) Len ¶
func (s *ImageItemList) Len() int
func (*ImageItemList) Pointers ¶
func (s *ImageItemList) Pointers() []any
func (*ImageItemList) Schema ¶
func (s *ImageItemList) Schema() []model.Field
type ImageRef ¶
func (*ImageRef) DecodeFields ¶
func (m *ImageRef) DecodeFields(r model.FieldReader)
func (*ImageRef) EncodeFields ¶
func (m *ImageRef) EncodeFields(w model.FieldWriter)
type ImageRefList ¶
type ImageRefList []*ImageRef
func (*ImageRefList) Append ¶
func (s *ImageRefList) Append() model.Fielder
func (*ImageRefList) DecodeFields ¶
func (s *ImageRefList) DecodeFields(_ model.FieldReader)
func (*ImageRefList) EncodeFields ¶
func (s *ImageRefList) EncodeFields(_ model.FieldWriter)
func (*ImageRefList) IsNil ¶
func (s *ImageRefList) IsNil() bool
func (*ImageRefList) Len ¶
func (s *ImageRefList) Len() int
func (*ImageRefList) Pointers ¶
func (s *ImageRefList) Pointers() []any
func (*ImageRefList) Schema ¶
func (s *ImageRefList) Schema() []model.Field
type Link ¶
func (*Link) DecodeFields ¶
func (m *Link) DecodeFields(r model.FieldReader)
func (*Link) EncodeFields ¶
func (m *Link) EncodeFields(w model.FieldWriter)
type LinkList ¶
type LinkList []*Link
func (*LinkList) DecodeFields ¶
func (s *LinkList) DecodeFields(_ model.FieldReader)
func (*LinkList) EncodeFields ¶
func (s *LinkList) EncodeFields(_ model.FieldWriter)
type Map ¶
type Map struct {
EmbedUrl string
}
func (*Map) DecodeFields ¶
func (m *Map) DecodeFields(r model.FieldReader)
func (*Map) EncodeFields ¶
func (m *Map) EncodeFields(w model.FieldWriter)
type MapList ¶
type MapList []*Map
func (*MapList) DecodeFields ¶
func (s *MapList) DecodeFields(_ model.FieldReader)
func (*MapList) EncodeFields ¶
func (s *MapList) EncodeFields(_ model.FieldWriter)
type MemoryCodec ¶
type MemoryCodec struct{}
MemoryCodec allows encoding and decoding a Content document safely in-memory.
func (MemoryCodec) Decode ¶
func (mc MemoryCodec) Decode(raw string, dest *Content)
func (MemoryCodec) Encode ¶
func (mc MemoryCodec) Encode(c *Content) string
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
func (*Module) MountOps ¶
func (m *Module) MountOps(reg router.OpRegistry)
type SEO ¶
func (*SEO) DecodeFields ¶
func (m *SEO) DecodeFields(r model.FieldReader)
func (*SEO) EncodeFields ¶
func (m *SEO) EncodeFields(w model.FieldWriter)
type SEOList ¶
type SEOList []*SEO
func (*SEOList) DecodeFields ¶
func (s *SEOList) DecodeFields(_ model.FieldReader)
func (*SEOList) EncodeFields ¶
func (s *SEOList) EncodeFields(_ model.FieldWriter)
type Schedule ¶
func (*Schedule) DecodeFields ¶
func (m *Schedule) DecodeFields(r model.FieldReader)
func (*Schedule) EncodeFields ¶
func (m *Schedule) EncodeFields(w model.FieldWriter)
type ScheduleList ¶
type ScheduleList []*Schedule
func (*ScheduleList) Append ¶
func (s *ScheduleList) Append() model.Fielder
func (*ScheduleList) DecodeFields ¶
func (s *ScheduleList) DecodeFields(_ model.FieldReader)
func (*ScheduleList) EncodeFields ¶
func (s *ScheduleList) EncodeFields(_ model.FieldWriter)
func (*ScheduleList) IsNil ¶
func (s *ScheduleList) IsNil() bool
func (*ScheduleList) Len ¶
func (s *ScheduleList) Len() int
func (*ScheduleList) Pointers ¶
func (s *ScheduleList) Pointers() []any
func (*ScheduleList) Schema ¶
func (s *ScheduleList) Schema() []model.Field
type Service ¶
func (*Service) DecodeFields ¶
func (m *Service) DecodeFields(r model.FieldReader)
func (*Service) EncodeFields ¶
func (m *Service) EncodeFields(w model.FieldWriter)
type ServiceList ¶
type ServiceList []*Service
func (*ServiceList) Append ¶
func (s *ServiceList) Append() model.Fielder
func (*ServiceList) DecodeFields ¶
func (s *ServiceList) DecodeFields(_ model.FieldReader)
func (*ServiceList) EncodeFields ¶
func (s *ServiceList) EncodeFields(_ model.FieldWriter)
func (*ServiceList) IsNil ¶
func (s *ServiceList) IsNil() bool
func (*ServiceList) Len ¶
func (s *ServiceList) Len() int
func (*ServiceList) Pointers ¶
func (s *ServiceList) Pointers() []any
func (*ServiceList) Schema ¶
func (s *ServiceList) Schema() []model.Field
type Stat ¶
func (*Stat) DecodeFields ¶
func (m *Stat) DecodeFields(r model.FieldReader)
func (*Stat) EncodeFields ¶
func (m *Stat) EncodeFields(w model.FieldWriter)
type StatList ¶
type StatList []*Stat
func (*StatList) DecodeFields ¶
func (s *StatList) DecodeFields(_ model.FieldReader)
func (*StatList) EncodeFields ¶
func (s *StatList) EncodeFields(_ model.FieldWriter)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.