entity

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: Apache-2.0 Imports: 33 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNamespace

func GetNamespace(contentType, status string) string

Types

type CacheIndex

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

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

func (*Content) AllAdminTypes

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) AllContents added in v0.1.48

func (c *Content) AllContents(contentType string) [][]byte

func (*Content) AllTypes

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

func (*Content) ApplyDomain

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) CreateDevice added in v0.2.3

func (c *Content) CreateDevice(device *valueobject.LicenseDevice) (string, error)

func (*Content) CreateLicenseIP added in v0.2.3

func (c *Content) CreateLicenseIP(ip *valueobject.LicenseIP) (string, error)

func (*Content) CreateLicenseUsage added in v0.2.5

func (c *Content) CreateLicenseUsage(licenseUsage *valueobject.LicenseUsage) (string, error)

CreateLicenseUsage 创建 LicenseUsage

func (*Content) CreatePublishDomain added in v0.2.3

func (c *Content) CreatePublishDomain(sd *valueobject.PublishDomain) (string, error)

func (*Content) CreateSubDomain added in v0.2.3

func (c *Content) CreateSubDomain(sd *valueobject.SubDomain) (string, error)

func (*Content) CreateSyncAccount added in v0.2.3

func (c *Content) CreateSyncAccount(sa *valueobject.SyncAccount) (string, error)

func (*Content) DeleteContent

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

func (*Content) DeleteContentObject added in v0.1.24

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

func (*Content) DeleteSubDomain added in v0.2.20

func (c *Content) DeleteSubDomain(sd *valueobject.SubDomain) error

func (*Content) GetContent

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

func (*Content) GetContentByHash

func (c *Content) GetContentByHash(contentType, hash, status string) ([]byte, error)

func (*Content) GetContentCreator

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

func (*Content) GetContentObject

func (c *Content) GetContentObject(contentType, id string) (any, error)

func (*Content) GetContents

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

func (*Content) GetDeployment

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

func (*Content) GetDeviceByID added in v0.2.3

func (c *Content) GetDeviceByID(licenseKey, deviceID string) (*valueobject.LicenseDevice, error)

func (*Content) GetDevicesByLicense added in v0.2.3

func (c *Content) GetDevicesByLicense(licenseKey string) ([]valueobject.LicenseDevice, error)

GetDevicesByLicense 获取某个 License 的所有设备 使用前缀查询: slug 格式为 "{license}:{deviceID}"

func (*Content) GetIPByAddress added in v0.2.3

func (c *Content) GetIPByAddress(licenseKey, address string) (*valueobject.LicenseIP, error)

func (*Content) GetIPsByLicense added in v0.2.3

func (c *Content) GetIPsByLicense(licenseKey string) ([]valueobject.LicenseIP, error)

GetIPsByLicense 获取某个 License 的所有 IP 记录 使用前缀查询: slug 格式为 "{license}:{ipAddress}"

func (*Content) GetLicenseByKey added in v0.2.3

func (c *Content) GetLicenseByKey(licenseKey string) (*valueobject.License, error)

GetLicenseByKey 通过 LicenseKey 获取 License

func (*Content) GetLicenseUsageByKey added in v0.2.5

func (c *Content) GetLicenseUsageByKey(licenseKey string) (*valueobject.LicenseUsage, error)

GetLicenseUsageByKey 通过 LicenseKey 获取 LicenseUsage

func (*Content) GetPublishDomainByKey added in v0.2.3

func (c *Content) GetPublishDomainByKey(license string) (*valueobject.PublishDomain, error)

func (*Content) GetRandomContent added in v0.1.27

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

func (*Content) GetSubDomainByKey added in v0.2.3

func (c *Content) GetSubDomainByKey(sub string) (*valueobject.SubDomain, error)

func (*Content) GetSyncAccountByLicense added in v0.2.3

func (c *Content) GetSyncAccountByLicense(licenseKey string) (*valueobject.SyncAccount, error)

func (*Content) IsAdminType

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

func (c *Content) NewPreview(domain *valueobject.Domain) (*valueobject.Preview, error)

func (*Content) NormalizeString

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

func (*Content) PreviewTarget

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

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

func (*Content) UpdateDevice added in v0.2.3

func (c *Content) UpdateDevice(device *valueobject.LicenseDevice) error

func (*Content) UpdateLicense added in v0.2.3

func (c *Content) UpdateLicense(license *valueobject.License) error

UpdateLicense 更新 License

func (*Content) UpdateLicenseIP added in v0.2.3

func (c *Content) UpdateLicenseIP(ip *valueobject.LicenseIP) error

func (*Content) UpdateLicenseUsage added in v0.2.5

func (c *Content) UpdateLicenseUsage(licenseUsage *valueobject.LicenseUsage) error

UpdateLicenseUsage 更新 LicenseUsage

func (*Content) UpdatePublishDomain added in v0.2.3

func (c *Content) UpdatePublishDomain(sd *valueobject.PublishDomain) error

func (*Content) UpdateSubDomain added in v0.2.3

func (c *Content) UpdateSubDomain(sd *valueobject.SubDomain) error

func (*Content) UpdateSyncAccount added in v0.2.3

func (c *Content) UpdateSyncAccount(sa *valueobject.SyncAccount) 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

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

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

type Writer

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