Documentation
¶
Index ¶
- func GetNamespace(contentType, status string) string
- type CacheIndex
- type Content
- func (c *Content) AllAdminTypeNames() []string
- func (c *Content) AllAdminTypes() map[string]content.Creator
- func (c *Content) AllContentTypeNames() []string
- func (c *Content) AllContentTypes() map[string]content.Creator
- func (c *Content) AllContents(contentType string) [][]byte
- func (c *Content) AllTypes() map[string]content.Creator
- func (c *Content) ApplyDomain(siteId string, domain string) (*valueobject.Domain, bool, error)
- func (c *Content) BuildTarget(contentType, id, status string) (string, error)
- func (c *Content) CreateDevice(device *valueobject.LicenseDevice) (string, error)
- func (c *Content) CreateLicenseIP(ip *valueobject.LicenseIP) (string, error)
- func (c *Content) CreateLicenseUsage(licenseUsage *valueobject.LicenseUsage) (string, error)
- func (c *Content) CreatePublishDomain(sd *valueobject.PublishDomain) (string, error)
- func (c *Content) CreateSubDomain(sd *valueobject.SubDomain) (string, error)
- func (c *Content) CreateSyncAccount(sa *valueobject.SyncAccount) (string, error)
- func (c *Content) DeleteContent(contentType, id, status string) error
- func (c *Content) DeleteContentObject(ci any) error
- func (c *Content) DeleteSubDomain(sd *valueobject.SubDomain) error
- func (c *Content) GetContent(contentType, id, status string) ([]byte, error)
- func (c *Content) GetContentByHash(contentType, hash, status string) ([]byte, error)
- func (c *Content) GetContentCreator(name string) (content.Creator, bool)
- func (c *Content) GetContentObject(contentType, id string) (any, error)
- func (c *Content) GetContents(ids []content.Identifier) ([][]byte, error)
- func (c *Content) GetDeployment(domain *valueobject.Domain, hostName string) (*valueobject.Deployment, error)
- func (c *Content) GetDeviceByID(licenseKey, deviceID string) (*valueobject.LicenseDevice, error)
- func (c *Content) GetDevicesByLicense(licenseKey string) ([]valueobject.LicenseDevice, error)
- func (c *Content) GetIPByAddress(licenseKey, address string) (*valueobject.LicenseIP, error)
- func (c *Content) GetIPsByLicense(licenseKey string) ([]valueobject.LicenseIP, error)
- func (c *Content) GetLicenseByKey(licenseKey string) (*valueobject.License, error)
- func (c *Content) GetLicenseUsageByKey(licenseKey string) (*valueobject.LicenseUsage, error)
- func (c *Content) GetPublishDomainByKey(license string) (*valueobject.PublishDomain, error)
- func (c *Content) GetRandomContent(contentType, status string) ([]byte, error)
- func (c *Content) GetSubDomainByKey(sub string) (*valueobject.SubDomain, error)
- func (c *Content) GetSyncAccountByLicense(licenseKey string) (*valueobject.SyncAccount, error)
- func (c *Content) IsAdminType(name string) bool
- func (c *Content) LoadHugoProject() error
- func (c *Content) Marshal(content any) ([]byte, error)
- func (c *Content) NewContent(contentType string, data url.Values) (string, error)
- func (c *Content) NewPreview(domain *valueobject.Domain) (*valueobject.Preview, error)
- func (c *Content) NormalizeString(s string) (string, error)
- func (c *Content) PreviewTarget(contentType, id, status string) (string, string, error)
- func (c *Content) SortContent(contentType string) error
- func (c *Content) Unmarshal(data []byte, content any) error
- func (c *Content) UpdateContent(contentType string, data url.Values) error
- func (c *Content) UpdateContentObject(ci any) error
- func (c *Content) UpdateDevice(device *valueobject.LicenseDevice) error
- func (c *Content) UpdateLicense(license *valueobject.License) error
- func (c *Content) UpdateLicenseIP(ip *valueobject.LicenseIP) error
- func (c *Content) UpdateLicenseUsage(licenseUsage *valueobject.LicenseUsage) error
- func (c *Content) UpdatePublishDomain(sd *valueobject.PublishDomain) error
- func (c *Content) UpdateSubDomain(sd *valueobject.SubDomain) error
- func (c *Content) UpdateSyncAccount(sa *valueobject.SyncAccount) error
- type Hugo
- type Search
- func (s *Search) DeleteIndex(id string) error
- func (s *Search) TermQuery(typeName string, keyValues map[string]string, count, offset int) ([]content.Identifier, error)
- func (s *Search) TypeQuery(typeName, query string, count, offset int) ([]content.Identifier, error)
- func (s *Search) UpdateIndex(ns, id string, data []byte) error
- type TypeService
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNamespace ¶
Types ¶
type CacheIndex ¶
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 (*Content) AllContentTypeNames ¶
func (*Content) AllContents ¶ added in v0.1.48
func (*Content) ApplyDomain ¶
func (*Content) BuildTarget ¶
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 (*Content) DeleteContentObject ¶ added in v0.1.24
func (*Content) DeleteSubDomain ¶ added in v0.2.20
func (c *Content) DeleteSubDomain(sd *valueobject.SubDomain) error
func (*Content) GetContent ¶
func (*Content) GetContentByHash ¶
func (*Content) GetContentCreator ¶
func (*Content) GetContentObject ¶
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 (*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 (*Content) LoadHugoProject ¶
func (*Content) NewContent ¶
func (*Content) NewPreview ¶
func (c *Content) NewPreview(domain *valueobject.Domain) (*valueobject.Preview, error)
func (*Content) PreviewTarget ¶
func (*Content) SortContent ¶
func (*Content) UpdateContent ¶
func (*Content) UpdateContentObject ¶
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 ¶
type Search ¶
type Search struct {
TypeService TypeService
Repo repository.Repository
Log loggers.Logger
IndicesMap map[string]*CacheIndex
// contains filtered or unexported fields
}
func (*Search) DeleteIndex ¶
DeleteIndex removes data from a content type's search index at the given identifier