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

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

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

func (*About) DecodeFields

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

func (*About) EncodeFields

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

func (*About) IsNil

func (m *About) IsNil() bool

func (*About) ModelName

func (m *About) ModelName() string

func (*About) Pointers

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

func (*About) Schema

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

func (*About) Validate

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

type AboutList

type AboutList []*About

func (*AboutList) Append

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

func (*AboutList) At

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

func (*AboutList) DecodeFields

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

func (*AboutList) EncodeFields

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

func (*AboutList) IsNil

func (s *AboutList) IsNil() bool

func (*AboutList) Len

func (s *AboutList) Len() int

func (*AboutList) Pointers

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

func (*AboutList) Schema

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

type Brand

type Brand struct {
	Name         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)

func (*Brand) IsNil

func (m *Brand) IsNil() bool

func (*Brand) ModelName

func (m *Brand) ModelName() string

func (*Brand) Pointers

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

func (*Brand) Schema

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

func (*Brand) Validate

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

type BrandList

type BrandList []*Brand

func (*BrandList) Append

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

func (*BrandList) At

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

func (*BrandList) DecodeFields

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

func (*BrandList) EncodeFields

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

func (*BrandList) IsNil

func (s *BrandList) IsNil() bool

func (*BrandList) Len

func (s *BrandList) Len() int

func (*BrandList) Pointers

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

func (*BrandList) Schema

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

type Contact

type Contact struct {
	Phone   string
	Email   string
	Address string
}

func (*Contact) DecodeFields

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

func (*Contact) EncodeFields

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

func (*Contact) IsNil

func (m *Contact) IsNil() bool

func (*Contact) ModelName

func (m *Contact) ModelName() string

func (*Contact) Pointers

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

func (*Contact) Schema

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

func (*Contact) Validate

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

type ContactList

type ContactList []*Contact

func (*ContactList) Append

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

func (*ContactList) At

func (s *ContactList) At(i int) 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 ReadOneContent

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

func (*Content) DecodeFields

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

func (*Content) EncodeFields

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

func (*Content) IsNil

func (m *Content) IsNil() bool

func (*Content) ModelName

func (m *Content) ModelName() string

func (*Content) Pointers

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

func (*Content) Schema

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

func (*Content) Validate

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

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) At

func (s *ContentList) At(i int) 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

type ContentRecord struct {
	SiteId string
	Data   string
}

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 Deps

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

type Hero

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

func (*Hero) DecodeFields

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

func (*Hero) EncodeFields

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

func (*Hero) IsNil

func (m *Hero) IsNil() bool

func (*Hero) ModelName

func (m *Hero) ModelName() string

func (*Hero) Pointers

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

func (*Hero) Schema

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

func (*Hero) Validate

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

type HeroList

type HeroList []*Hero

func (*HeroList) Append

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

func (*HeroList) At

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

func (*HeroList) DecodeFields

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

func (*HeroList) EncodeFields

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

func (*HeroList) IsNil

func (s *HeroList) IsNil() bool

func (*HeroList) Len

func (s *HeroList) Len() int

func (*HeroList) Pointers

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

func (*HeroList) Schema

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

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)

func (*ImageItem) IsNil

func (m *ImageItem) IsNil() bool

func (*ImageItem) ModelName

func (m *ImageItem) ModelName() string

func (*ImageItem) Pointers

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

func (*ImageItem) Schema

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

func (*ImageItem) Validate

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

type ImageItemList

type ImageItemList []*ImageItem

func (*ImageItemList) Append

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

func (*ImageItemList) At

func (s *ImageItemList) At(i int) 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

type ImageRef struct {
	Key   string
	Alt   string
	Usage string
}

func (*ImageRef) DecodeFields

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

func (*ImageRef) EncodeFields

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

func (*ImageRef) IsNil

func (m *ImageRef) IsNil() bool

func (*ImageRef) ModelName

func (m *ImageRef) ModelName() string

func (*ImageRef) Pointers

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

func (*ImageRef) Schema

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

func (*ImageRef) Validate

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

type ImageRefList

type ImageRefList []*ImageRef

func (*ImageRefList) Append

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

func (*ImageRefList) At

func (s *ImageRefList) At(i int) 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 struct {
	Text string
	Url  string
}

func (*Link) DecodeFields

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

func (*Link) EncodeFields

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

func (*Link) IsNil

func (m *Link) IsNil() bool

func (*Link) ModelName

func (m *Link) ModelName() string

func (*Link) Pointers

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

func (*Link) Schema

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

func (*Link) Validate

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

func (*LinkList) Append

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

func (*LinkList) At

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

func (*LinkList) DecodeFields

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

func (*LinkList) EncodeFields

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

func (*LinkList) IsNil

func (s *LinkList) IsNil() bool

func (*LinkList) Len

func (s *LinkList) Len() int

func (*LinkList) Pointers

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

func (*LinkList) Schema

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

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)

func (*Map) IsNil

func (m *Map) IsNil() bool

func (*Map) ModelName

func (m *Map) ModelName() string

func (*Map) Pointers

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

func (*Map) Schema

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

func (*Map) Validate

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

type MapList

type MapList []*Map

func (*MapList) Append

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

func (*MapList) At

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

func (*MapList) DecodeFields

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

func (*MapList) EncodeFields

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

func (*MapList) IsNil

func (s *MapList) IsNil() bool

func (*MapList) Len

func (s *MapList) Len() int

func (*MapList) Pointers

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

func (*MapList) Schema

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

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 New

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

func (*Module) Get

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

func (*Module) ModelName

func (m *Module) ModelName() string

func (*Module) MountOps

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

func (*Module) OpGet

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

func (*Module) OpSave

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

func (*Module) Save

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

type SEO

type SEO struct {
	Description string
	SocialImage string
	SchemaType  string
}

func (*SEO) DecodeFields

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

func (*SEO) EncodeFields

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

func (*SEO) IsNil

func (m *SEO) IsNil() bool

func (*SEO) ModelName

func (m *SEO) ModelName() string

func (*SEO) Pointers

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

func (*SEO) Schema

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

func (*SEO) Validate

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

type SEOList

type SEOList []*SEO

func (*SEOList) Append

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

func (*SEOList) At

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

func (*SEOList) DecodeFields

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

func (*SEOList) EncodeFields

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

func (*SEOList) IsNil

func (s *SEOList) IsNil() bool

func (*SEOList) Len

func (s *SEOList) Len() int

func (*SEOList) Pointers

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

func (*SEOList) Schema

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

type Schedule

type Schedule struct {
	Days  string
	Hours string
}

func (*Schedule) DecodeFields

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

func (*Schedule) EncodeFields

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

func (*Schedule) IsNil

func (m *Schedule) IsNil() bool

func (*Schedule) ModelName

func (m *Schedule) ModelName() string

func (*Schedule) Pointers

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

func (*Schedule) Schema

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

func (*Schedule) Validate

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

type ScheduleList

type ScheduleList []*Schedule

func (*ScheduleList) Append

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

func (*ScheduleList) At

func (s *ScheduleList) At(i int) 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

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

func (*Service) DecodeFields

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

func (*Service) EncodeFields

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

func (*Service) IsNil

func (m *Service) IsNil() bool

func (*Service) ModelName

func (m *Service) ModelName() string

func (*Service) Pointers

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

func (*Service) Schema

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

func (*Service) Validate

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

type ServiceList

type ServiceList []*Service

func (*ServiceList) Append

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

func (*ServiceList) At

func (s *ServiceList) At(i int) 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

type Stat struct {
	Value string
	Label string
}

func (*Stat) DecodeFields

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

func (*Stat) EncodeFields

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

func (*Stat) IsNil

func (m *Stat) IsNil() bool

func (*Stat) ModelName

func (m *Stat) ModelName() string

func (*Stat) Pointers

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

func (*Stat) Schema

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

func (*Stat) Validate

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

type StatList

type StatList []*Stat

func (*StatList) Append

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

func (*StatList) At

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

func (*StatList) DecodeFields

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

func (*StatList) EncodeFields

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

func (*StatList) IsNil

func (s *StatList) IsNil() bool

func (*StatList) Len

func (s *StatList) Len() int

func (*StatList) Pointers

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

func (*StatList) Schema

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

Jump to

Keyboard shortcuts

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