entity

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespace

func GetNamespace(contentType, status string) string

Types

type CacheIndex added in v0.0.12

type CacheIndex struct {
	bleve.Index
	// contains filtered or unexported fields
}

type Content

type Content struct {
	UserTypes  map[string]content.Creator
	AdminTypes map[string]content.Creator
	Repo       repository.Repository

	*Search
	*Hugo

	Log loggers.Logger
}

func (*Content) AllAdminTypeNames added in v0.0.5

func (c *Content) AllAdminTypeNames() []string

func (*Content) AllAdminTypes added in v0.0.5

func (c *Content) AllAdminTypes() map[string]content.Creator

func (*Content) AllContentTypeNames

func (c *Content) AllContentTypeNames() []string

func (*Content) AllContentTypes

func (c *Content) AllContentTypes() map[string]content.Creator

func (*Content) AllTypes added in v0.0.5

func (c *Content) AllTypes() map[string]content.Creator

func (*Content) ApplyDomain added in v0.1.0

func (c *Content) ApplyDomain(siteId string, domain string) (*valueobject.Domain, bool, error)

func (*Content) BuildTarget

func (c *Content) BuildTarget(contentType, id, status string) (string, error)

func (*Content) DeleteContent

func (c *Content) DeleteContent(contentType, id, status string) error

func (*Content) GetContent

func (c *Content) GetContent(contentType, id, status string) ([]byte, error)

func (*Content) GetContentCreator

func (c *Content) GetContentCreator(name string) (content.Creator, bool)

func (*Content) GetContents

func (c *Content) GetContents(ids []content.Identifier) ([][]byte, error)

func (*Content) GetDeployment added in v0.0.5

func (c *Content) GetDeployment(domain *valueobject.Domain, hostName string) (*valueobject.Deployment, error)

func (*Content) IsAdminType added in v0.0.5

func (c *Content) IsAdminType(name string) bool

func (*Content) LoadHugoProject

func (c *Content) LoadHugoProject() error

func (*Content) Marshal

func (c *Content) Marshal(content any) ([]byte, error)

func (*Content) NewContent

func (c *Content) NewContent(contentType string, data url.Values) (string, error)

func (*Content) NormalizeString

func (c *Content) NormalizeString(s string) (string, error)

func (*Content) PreviewTarget added in v0.0.5

func (c *Content) PreviewTarget(contentType, id, status string) (string, string, error)

func (*Content) SortContent

func (c *Content) SortContent(contentType string) error

func (*Content) Unmarshal

func (c *Content) Unmarshal(data []byte, content any) error

func (*Content) UpdateContent

func (c *Content) UpdateContent(contentType string, data url.Values) error

func (*Content) UpdateContentObject added in v0.0.5

func (c *Content) UpdateContentObject(ci any) error

type Hugo

type Hugo struct {
	Services content.Services
	Fs       afero.Fs

	DirService content.DirService

	Log loggers.Logger
	// contains filtered or unexported fields
}

func (*Hugo) LoadProject

func (h *Hugo) LoadProject(c contentSvc) error
type Search struct {
	TypeService TypeService

	Repo repository.Repository
	Log  loggers.Logger

	IndicesMap map[string]*CacheIndex
	// contains filtered or unexported fields
}

func (*Search) DeleteIndex

func (s *Search) DeleteIndex(id string) error

DeleteIndex removes data from a content type's search index at the given identifier

func (*Search) TermQuery added in v0.1.0

func (s *Search) TermQuery(typeName string, keyValues map[string]string, count, offset int) ([]content.Identifier, error)

func (*Search) TypeQuery

func (s *Search) TypeQuery(typeName, query string, count, offset int) ([]content.Identifier, error)

TypeQuery conducts a search and returns a set of Ponzu "targets", Type:ID pairs, and an error. If there is no search index for the typeName (Type) provided, db.ErrNoIndex will be returned as the error

func (*Search) UpdateIndex

func (s *Search) UpdateIndex(ns, id string, data []byte) error

UpdateIndex sets data into a content type's search index at the given identifier

type TypeService added in v0.0.5

type TypeService interface {
	GetContentCreator(name string) (content.Creator, bool)
	AllContentTypeNames() []string
	AllAdminTypeNames() []string
	IsAdminType(name string) bool
}

type Writer added in v0.0.5

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

Jump to

Keyboard shortcuts

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