sitecontent

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 5 Imported by: 0

README

site_content

Esquema del contenido editable de un sitio de cliente dentro del producto misitio (misitio.velty.cl).

Inicio Rápido

import (
	"github.com/tinywasm/orm"
	"github.com/tinywasm/storage/mem"
	"github.com/veltylabs/site_content"
)

db := orm.New(mem.New())
m, err := sitecontent.New(sitecontent.Deps{
	DB: db,
	IDs: myIDGenerator,
})

content := &sitecontent.Content{
	SiteId: "sitio-demo",
	Brand: sitecontent.Brand{Name: "Empresa Demo", PrimaryColor: "#0055ff"},
	Contact: sitecontent.Contact{Phone: "+56900000000", Email: "info@demo.cl", Address: "Santiago"},
	Seo: sitecontent.SEO{Description: "Sitio web de demostracion"},
}

err = m.Save(content)

Operaciones

Op Recurso Acción Descripción
get site_content model.Read Obtiene el contenido del sitio por SiteID.
save site_content model.Create | model.Update Valida y guarda el contenido del sitio.

Archivos Clave

  • content.go: Definición del modelo raíz Content.
  • validate.go: Reglas de validación avanzadas (unicidades de servicio, slugs, formato de color).
  • module.go: Implementación del módulo y de la interfaz router.OpModule.
  • docs/ARCHITECTURE.md: Documentación de arquitectura y ciclo de vida.
  • docs/diagrams/database.md: Diagrama de entidades en Mermaid.

Documentation

Index

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

func Validate added in v0.1.0

func Validate(c *Content) error

Validate runs model.ValidateFields over the entire document and additionally enforces rules that the schema alone cannot express: the three uniqueness rules of Service, slug formatting, and PrimaryColor format.

Types

type About added in v0.1.0

type About struct {
	Title   string
	Body    string
	Image   string
	Mission string
	Vision  string
}

func (*About) DecodeFields added in v0.1.0

func (m *About) DecodeFields(r model.FieldReader)

func (*About) EncodeFields added in v0.1.0

func (m *About) EncodeFields(w model.FieldWriter)

func (*About) IsNil added in v0.1.0

func (m *About) IsNil() bool

func (*About) ModelName added in v0.1.0

func (m *About) ModelName() string

func (*About) Pointers added in v0.1.0

func (m *About) Pointers() []any

func (*About) Schema added in v0.1.0

func (m *About) Schema() []model.Field

func (*About) Validate added in v0.1.0

func (m *About) Validate(action byte) error

type AboutList added in v0.1.0

type AboutList []*About

func (*AboutList) Append added in v0.1.0

func (s *AboutList) Append() model.Fielder

func (*AboutList) At added in v0.1.0

func (s *AboutList) At(i int) model.Fielder

func (*AboutList) DecodeFields added in v0.1.0

func (s *AboutList) DecodeFields(_ model.FieldReader)

func (*AboutList) EncodeFields added in v0.1.0

func (s *AboutList) EncodeFields(_ model.FieldWriter)

func (*AboutList) IsNil added in v0.1.0

func (s *AboutList) IsNil() bool

func (*AboutList) Len added in v0.1.0

func (s *AboutList) Len() int

func (*AboutList) Pointers added in v0.1.0

func (s *AboutList) Pointers() []any

func (*AboutList) Schema added in v0.1.0

func (s *AboutList) Schema() []model.Field

type Brand added in v0.1.0

type Brand struct {
	Name         string
	LogoAlt      string
	PrimaryColor string
}

func (*Brand) DecodeFields added in v0.1.0

func (m *Brand) DecodeFields(r model.FieldReader)

func (*Brand) EncodeFields added in v0.1.0

func (m *Brand) EncodeFields(w model.FieldWriter)

func (*Brand) IsNil added in v0.1.0

func (m *Brand) IsNil() bool

func (*Brand) ModelName added in v0.1.0

func (m *Brand) ModelName() string

func (*Brand) Pointers added in v0.1.0

func (m *Brand) Pointers() []any

func (*Brand) Schema added in v0.1.0

func (m *Brand) Schema() []model.Field

func (*Brand) Validate added in v0.1.0

func (m *Brand) Validate(action byte) error

type BrandList added in v0.1.0

type BrandList []*Brand

func (*BrandList) Append added in v0.1.0

func (s *BrandList) Append() model.Fielder

func (*BrandList) At added in v0.1.0

func (s *BrandList) At(i int) model.Fielder

func (*BrandList) DecodeFields added in v0.1.0

func (s *BrandList) DecodeFields(_ model.FieldReader)

func (*BrandList) EncodeFields added in v0.1.0

func (s *BrandList) EncodeFields(_ model.FieldWriter)

func (*BrandList) IsNil added in v0.1.0

func (s *BrandList) IsNil() bool

func (*BrandList) Len added in v0.1.0

func (s *BrandList) Len() int

func (*BrandList) Pointers added in v0.1.0

func (s *BrandList) Pointers() []any

func (*BrandList) Schema added in v0.1.0

func (s *BrandList) Schema() []model.Field

type Contact added in v0.1.0

type Contact struct {
	Phone   string
	Email   string
	Address string
}

func (*Contact) DecodeFields added in v0.1.0

func (m *Contact) DecodeFields(r model.FieldReader)

func (*Contact) EncodeFields added in v0.1.0

func (m *Contact) EncodeFields(w model.FieldWriter)

func (*Contact) IsNil added in v0.1.0

func (m *Contact) IsNil() bool

func (*Contact) ModelName added in v0.1.0

func (m *Contact) ModelName() string

func (*Contact) Pointers added in v0.1.0

func (m *Contact) Pointers() []any

func (*Contact) Schema added in v0.1.0

func (m *Contact) Schema() []model.Field

func (*Contact) Validate added in v0.1.0

func (m *Contact) Validate(action byte) error

type ContactList added in v0.1.0

type ContactList []*Contact

func (*ContactList) Append added in v0.1.0

func (s *ContactList) Append() model.Fielder

func (*ContactList) At added in v0.1.0

func (s *ContactList) At(i int) model.Fielder

func (*ContactList) DecodeFields added in v0.1.0

func (s *ContactList) DecodeFields(_ model.FieldReader)

func (*ContactList) EncodeFields added in v0.1.0

func (s *ContactList) EncodeFields(_ model.FieldWriter)

func (*ContactList) IsNil added in v0.1.0

func (s *ContactList) IsNil() bool

func (*ContactList) Len added in v0.1.0

func (s *ContactList) Len() int

func (*ContactList) Pointers added in v0.1.0

func (s *ContactList) Pointers() []any

func (*ContactList) Schema added in v0.1.0

func (s *ContactList) Schema() []model.Field

type Content added in v0.1.0

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 ReadOneContent added in v0.1.0

func ReadOneContent(qb *orm.QB, model *Content) (*Content, error)

func (*Content) DecodeFields added in v0.1.0

func (m *Content) DecodeFields(r model.FieldReader)

func (*Content) EncodeFields added in v0.1.0

func (m *Content) EncodeFields(w model.FieldWriter)

func (*Content) IsNil added in v0.1.0

func (m *Content) IsNil() bool

func (*Content) ModelName added in v0.1.0

func (m *Content) ModelName() string

func (*Content) Pointers added in v0.1.0

func (m *Content) Pointers() []any

func (*Content) Schema added in v0.1.0

func (m *Content) Schema() []model.Field

func (*Content) Validate added in v0.1.0

func (m *Content) Validate(action byte) error

type ContentList added in v0.1.0

type ContentList []*Content

func ReadAllContent added in v0.1.0

func ReadAllContent(qb *orm.QB) (ContentList, error)

func (*ContentList) Append added in v0.1.0

func (s *ContentList) Append() model.Fielder

func (*ContentList) At added in v0.1.0

func (s *ContentList) At(i int) model.Fielder

func (*ContentList) DecodeFields added in v0.1.0

func (s *ContentList) DecodeFields(_ model.FieldReader)

func (*ContentList) EncodeFields added in v0.1.0

func (s *ContentList) EncodeFields(_ model.FieldWriter)

func (*ContentList) IsNil added in v0.1.0

func (s *ContentList) IsNil() bool

func (*ContentList) Len added in v0.1.0

func (s *ContentList) Len() int

func (*ContentList) Pointers added in v0.1.0

func (s *ContentList) Pointers() []any

func (*ContentList) Schema added in v0.1.0

func (s *ContentList) Schema() []model.Field

type ContentRecord added in v0.1.0

type ContentRecord struct {
	SiteId string
	Data   string
}

func (*ContentRecord) DecodeFields added in v0.1.0

func (m *ContentRecord) DecodeFields(r model.FieldReader)

func (*ContentRecord) EncodeFields added in v0.1.0

func (m *ContentRecord) EncodeFields(w model.FieldWriter)

func (*ContentRecord) IsNil added in v0.1.0

func (m *ContentRecord) IsNil() bool

func (*ContentRecord) ModelName added in v0.1.0

func (m *ContentRecord) ModelName() string

func (*ContentRecord) Pointers added in v0.1.0

func (m *ContentRecord) Pointers() []any

func (*ContentRecord) Schema added in v0.1.0

func (m *ContentRecord) Schema() []model.Field

func (*ContentRecord) Validate added in v0.1.0

func (m *ContentRecord) Validate(action byte) error

type Deps added in v0.1.0

type Deps struct {
	DB  *orm.DB
	IDs model.IDGenerator
}

type Hero added in v0.1.0

type Hero struct {
	Title    string
	Subtitle string
	CtAs     []Link
	Images   []ImageItem
}

func (*Hero) DecodeFields added in v0.1.0

func (m *Hero) DecodeFields(r model.FieldReader)

func (*Hero) EncodeFields added in v0.1.0

func (m *Hero) EncodeFields(w model.FieldWriter)

func (*Hero) IsNil added in v0.1.0

func (m *Hero) IsNil() bool

func (*Hero) ModelName added in v0.1.0

func (m *Hero) ModelName() string

func (*Hero) Pointers added in v0.1.0

func (m *Hero) Pointers() []any

func (*Hero) Schema added in v0.1.0

func (m *Hero) Schema() []model.Field

func (*Hero) Validate added in v0.1.0

func (m *Hero) Validate(action byte) error

type HeroList added in v0.1.0

type HeroList []*Hero

func (*HeroList) Append added in v0.1.0

func (s *HeroList) Append() model.Fielder

func (*HeroList) At added in v0.1.0

func (s *HeroList) At(i int) model.Fielder

func (*HeroList) DecodeFields added in v0.1.0

func (s *HeroList) DecodeFields(_ model.FieldReader)

func (*HeroList) EncodeFields added in v0.1.0

func (s *HeroList) EncodeFields(_ model.FieldWriter)

func (*HeroList) IsNil added in v0.1.0

func (s *HeroList) IsNil() bool

func (*HeroList) Len added in v0.1.0

func (s *HeroList) Len() int

func (*HeroList) Pointers added in v0.1.0

func (s *HeroList) Pointers() []any

func (*HeroList) Schema added in v0.1.0

func (s *HeroList) Schema() []model.Field

type ImageItem added in v0.1.0

type ImageItem struct {
	Key string
}

func (*ImageItem) DecodeFields added in v0.1.0

func (m *ImageItem) DecodeFields(r model.FieldReader)

func (*ImageItem) EncodeFields added in v0.1.0

func (m *ImageItem) EncodeFields(w model.FieldWriter)

func (*ImageItem) IsNil added in v0.1.0

func (m *ImageItem) IsNil() bool

func (*ImageItem) ModelName added in v0.1.0

func (m *ImageItem) ModelName() string

func (*ImageItem) Pointers added in v0.1.0

func (m *ImageItem) Pointers() []any

func (*ImageItem) Schema added in v0.1.0

func (m *ImageItem) Schema() []model.Field

func (*ImageItem) Validate added in v0.1.0

func (m *ImageItem) Validate(action byte) error

type ImageItemList added in v0.1.0

type ImageItemList []*ImageItem

func (*ImageItemList) Append added in v0.1.0

func (s *ImageItemList) Append() model.Fielder

func (*ImageItemList) At added in v0.1.0

func (s *ImageItemList) At(i int) model.Fielder

func (*ImageItemList) DecodeFields added in v0.1.0

func (s *ImageItemList) DecodeFields(_ model.FieldReader)

func (*ImageItemList) EncodeFields added in v0.1.0

func (s *ImageItemList) EncodeFields(_ model.FieldWriter)

func (*ImageItemList) IsNil added in v0.1.0

func (s *ImageItemList) IsNil() bool

func (*ImageItemList) Len added in v0.1.0

func (s *ImageItemList) Len() int

func (*ImageItemList) Pointers added in v0.1.0

func (s *ImageItemList) Pointers() []any

func (*ImageItemList) Schema added in v0.1.0

func (s *ImageItemList) Schema() []model.Field

type ImageRef added in v0.1.0

type ImageRef struct {
	Key   string
	Alt   string
	Usage string
}

func (*ImageRef) DecodeFields added in v0.1.0

func (m *ImageRef) DecodeFields(r model.FieldReader)

func (*ImageRef) EncodeFields added in v0.1.0

func (m *ImageRef) EncodeFields(w model.FieldWriter)

func (*ImageRef) IsNil added in v0.1.0

func (m *ImageRef) IsNil() bool

func (*ImageRef) ModelName added in v0.1.0

func (m *ImageRef) ModelName() string

func (*ImageRef) Pointers added in v0.1.0

func (m *ImageRef) Pointers() []any

func (*ImageRef) Schema added in v0.1.0

func (m *ImageRef) Schema() []model.Field

func (*ImageRef) Validate added in v0.1.0

func (m *ImageRef) Validate(action byte) error

type ImageRefList added in v0.1.0

type ImageRefList []*ImageRef

func (*ImageRefList) Append added in v0.1.0

func (s *ImageRefList) Append() model.Fielder

func (*ImageRefList) At added in v0.1.0

func (s *ImageRefList) At(i int) model.Fielder

func (*ImageRefList) DecodeFields added in v0.1.0

func (s *ImageRefList) DecodeFields(_ model.FieldReader)

func (*ImageRefList) EncodeFields added in v0.1.0

func (s *ImageRefList) EncodeFields(_ model.FieldWriter)

func (*ImageRefList) IsNil added in v0.1.0

func (s *ImageRefList) IsNil() bool

func (*ImageRefList) Len added in v0.1.0

func (s *ImageRefList) Len() int

func (*ImageRefList) Pointers added in v0.1.0

func (s *ImageRefList) Pointers() []any

func (*ImageRefList) Schema added in v0.1.0

func (s *ImageRefList) Schema() []model.Field
type Link struct {
	Text string
	Url  string
}

func (*Link) DecodeFields added in v0.1.0

func (m *Link) DecodeFields(r model.FieldReader)

func (*Link) EncodeFields added in v0.1.0

func (m *Link) EncodeFields(w model.FieldWriter)

func (*Link) IsNil added in v0.1.0

func (m *Link) IsNil() bool

func (*Link) ModelName added in v0.1.0

func (m *Link) ModelName() string

func (*Link) Pointers added in v0.1.0

func (m *Link) Pointers() []any

func (*Link) Schema added in v0.1.0

func (m *Link) Schema() []model.Field

func (*Link) Validate added in v0.1.0

func (m *Link) Validate(action byte) error
type LinkList []*Link

func (*LinkList) Append added in v0.1.0

func (s *LinkList) Append() model.Fielder

func (*LinkList) At added in v0.1.0

func (s *LinkList) At(i int) model.Fielder

func (*LinkList) DecodeFields added in v0.1.0

func (s *LinkList) DecodeFields(_ model.FieldReader)

func (*LinkList) EncodeFields added in v0.1.0

func (s *LinkList) EncodeFields(_ model.FieldWriter)

func (*LinkList) IsNil added in v0.1.0

func (s *LinkList) IsNil() bool

func (*LinkList) Len added in v0.1.0

func (s *LinkList) Len() int

func (*LinkList) Pointers added in v0.1.0

func (s *LinkList) Pointers() []any

func (*LinkList) Schema added in v0.1.0

func (s *LinkList) Schema() []model.Field

type Map added in v0.1.0

type Map struct {
	EmbedUrl string
}

func (*Map) DecodeFields added in v0.1.0

func (m *Map) DecodeFields(r model.FieldReader)

func (*Map) EncodeFields added in v0.1.0

func (m *Map) EncodeFields(w model.FieldWriter)

func (*Map) IsNil added in v0.1.0

func (m *Map) IsNil() bool

func (*Map) ModelName added in v0.1.0

func (m *Map) ModelName() string

func (*Map) Pointers added in v0.1.0

func (m *Map) Pointers() []any

func (*Map) Schema added in v0.1.0

func (m *Map) Schema() []model.Field

func (*Map) Validate added in v0.1.0

func (m *Map) Validate(action byte) error

type MapList added in v0.1.0

type MapList []*Map

func (*MapList) Append added in v0.1.0

func (s *MapList) Append() model.Fielder

func (*MapList) At added in v0.1.0

func (s *MapList) At(i int) model.Fielder

func (*MapList) DecodeFields added in v0.1.0

func (s *MapList) DecodeFields(_ model.FieldReader)

func (*MapList) EncodeFields added in v0.1.0

func (s *MapList) EncodeFields(_ model.FieldWriter)

func (*MapList) IsNil added in v0.1.0

func (s *MapList) IsNil() bool

func (*MapList) Len added in v0.1.0

func (s *MapList) Len() int

func (*MapList) Pointers added in v0.1.0

func (s *MapList) Pointers() []any

func (*MapList) Schema added in v0.1.0

func (s *MapList) Schema() []model.Field

type MemoryCodec added in v0.1.0

type MemoryCodec struct{}

MemoryCodec allows encoding and decoding a Content document safely in-memory.

func (MemoryCodec) Decode added in v0.1.0

func (mc MemoryCodec) Decode(raw string, dest *Content)

func (MemoryCodec) Encode added in v0.1.0

func (mc MemoryCodec) Encode(c *Content) string

type Module added in v0.1.0

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

func New

func New(d Deps) (*Module, error)

func (*Module) Get added in v0.1.0

func (m *Module) Get(siteID string) (*Content, error)

func (*Module) ModelName added in v0.1.0

func (m *Module) ModelName() string

func (*Module) MountOps added in v0.1.0

func (m *Module) MountOps(reg router.OpRegistry)

func (*Module) OpGet added in v0.1.0

func (m *Module) OpGet(ctx router.Context)

func (*Module) OpSave added in v0.1.0

func (m *Module) OpSave(ctx router.Context)

func (*Module) Save added in v0.1.0

func (m *Module) Save(c *Content) error

type SEO added in v0.1.0

type SEO struct {
	Description string
	SocialImage string
	SchemaType  string
}

func (*SEO) DecodeFields added in v0.1.0

func (m *SEO) DecodeFields(r model.FieldReader)

func (*SEO) EncodeFields added in v0.1.0

func (m *SEO) EncodeFields(w model.FieldWriter)

func (*SEO) IsNil added in v0.1.0

func (m *SEO) IsNil() bool

func (*SEO) ModelName added in v0.1.0

func (m *SEO) ModelName() string

func (*SEO) Pointers added in v0.1.0

func (m *SEO) Pointers() []any

func (*SEO) Schema added in v0.1.0

func (m *SEO) Schema() []model.Field

func (*SEO) Validate added in v0.1.0

func (m *SEO) Validate(action byte) error

type SEOList added in v0.1.0

type SEOList []*SEO

func (*SEOList) Append added in v0.1.0

func (s *SEOList) Append() model.Fielder

func (*SEOList) At added in v0.1.0

func (s *SEOList) At(i int) model.Fielder

func (*SEOList) DecodeFields added in v0.1.0

func (s *SEOList) DecodeFields(_ model.FieldReader)

func (*SEOList) EncodeFields added in v0.1.0

func (s *SEOList) EncodeFields(_ model.FieldWriter)

func (*SEOList) IsNil added in v0.1.0

func (s *SEOList) IsNil() bool

func (*SEOList) Len added in v0.1.0

func (s *SEOList) Len() int

func (*SEOList) Pointers added in v0.1.0

func (s *SEOList) Pointers() []any

func (*SEOList) Schema added in v0.1.0

func (s *SEOList) Schema() []model.Field

type Schedule added in v0.1.0

type Schedule struct {
	Days  string
	Hours string
}

func (*Schedule) DecodeFields added in v0.1.0

func (m *Schedule) DecodeFields(r model.FieldReader)

func (*Schedule) EncodeFields added in v0.1.0

func (m *Schedule) EncodeFields(w model.FieldWriter)

func (*Schedule) IsNil added in v0.1.0

func (m *Schedule) IsNil() bool

func (*Schedule) ModelName added in v0.1.0

func (m *Schedule) ModelName() string

func (*Schedule) Pointers added in v0.1.0

func (m *Schedule) Pointers() []any

func (*Schedule) Schema added in v0.1.0

func (m *Schedule) Schema() []model.Field

func (*Schedule) Validate added in v0.1.0

func (m *Schedule) Validate(action byte) error

type ScheduleList added in v0.1.0

type ScheduleList []*Schedule

func (*ScheduleList) Append added in v0.1.0

func (s *ScheduleList) Append() model.Fielder

func (*ScheduleList) At added in v0.1.0

func (s *ScheduleList) At(i int) model.Fielder

func (*ScheduleList) DecodeFields added in v0.1.0

func (s *ScheduleList) DecodeFields(_ model.FieldReader)

func (*ScheduleList) EncodeFields added in v0.1.0

func (s *ScheduleList) EncodeFields(_ model.FieldWriter)

func (*ScheduleList) IsNil added in v0.1.0

func (s *ScheduleList) IsNil() bool

func (*ScheduleList) Len added in v0.1.0

func (s *ScheduleList) Len() int

func (*ScheduleList) Pointers added in v0.1.0

func (s *ScheduleList) Pointers() []any

func (*ScheduleList) Schema added in v0.1.0

func (s *ScheduleList) Schema() []model.Field

type Service added in v0.1.0

type Service struct {
	Slug        string
	Title       string
	Description string
	Image       string
	Body        string
}

func (*Service) DecodeFields added in v0.1.0

func (m *Service) DecodeFields(r model.FieldReader)

func (*Service) EncodeFields added in v0.1.0

func (m *Service) EncodeFields(w model.FieldWriter)

func (*Service) IsNil added in v0.1.0

func (m *Service) IsNil() bool

func (*Service) ModelName added in v0.1.0

func (m *Service) ModelName() string

func (*Service) Pointers added in v0.1.0

func (m *Service) Pointers() []any

func (*Service) Schema added in v0.1.0

func (m *Service) Schema() []model.Field

func (*Service) Validate added in v0.1.0

func (m *Service) Validate(action byte) error

type ServiceList added in v0.1.0

type ServiceList []*Service

func (*ServiceList) Append added in v0.1.0

func (s *ServiceList) Append() model.Fielder

func (*ServiceList) At added in v0.1.0

func (s *ServiceList) At(i int) model.Fielder

func (*ServiceList) DecodeFields added in v0.1.0

func (s *ServiceList) DecodeFields(_ model.FieldReader)

func (*ServiceList) EncodeFields added in v0.1.0

func (s *ServiceList) EncodeFields(_ model.FieldWriter)

func (*ServiceList) IsNil added in v0.1.0

func (s *ServiceList) IsNil() bool

func (*ServiceList) Len added in v0.1.0

func (s *ServiceList) Len() int

func (*ServiceList) Pointers added in v0.1.0

func (s *ServiceList) Pointers() []any

func (*ServiceList) Schema added in v0.1.0

func (s *ServiceList) Schema() []model.Field

type Stat added in v0.1.0

type Stat struct {
	Value string
	Label string
}

func (*Stat) DecodeFields added in v0.1.0

func (m *Stat) DecodeFields(r model.FieldReader)

func (*Stat) EncodeFields added in v0.1.0

func (m *Stat) EncodeFields(w model.FieldWriter)

func (*Stat) IsNil added in v0.1.0

func (m *Stat) IsNil() bool

func (*Stat) ModelName added in v0.1.0

func (m *Stat) ModelName() string

func (*Stat) Pointers added in v0.1.0

func (m *Stat) Pointers() []any

func (*Stat) Schema added in v0.1.0

func (m *Stat) Schema() []model.Field

func (*Stat) Validate added in v0.1.0

func (m *Stat) Validate(action byte) error

type StatList added in v0.1.0

type StatList []*Stat

func (*StatList) Append added in v0.1.0

func (s *StatList) Append() model.Fielder

func (*StatList) At added in v0.1.0

func (s *StatList) At(i int) model.Fielder

func (*StatList) DecodeFields added in v0.1.0

func (s *StatList) DecodeFields(_ model.FieldReader)

func (*StatList) EncodeFields added in v0.1.0

func (s *StatList) EncodeFields(_ model.FieldWriter)

func (*StatList) IsNil added in v0.1.0

func (s *StatList) IsNil() bool

func (*StatList) Len added in v0.1.0

func (s *StatList) Len() int

func (*StatList) Pointers added in v0.1.0

func (s *StatList) Pointers() []any

func (*StatList) Schema added in v0.1.0

func (s *StatList) Schema() []model.Field

Jump to

Keyboard shortcuts

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