Documentation
¶
Index ¶
- func EnoughTime(key string, cb func(key string) error) bool
- func GetIdFromQueryString(queryString string) (string, error)
- func Slug(i content.Identifiable) (string, error)
- func StringToSlug(s string) (string, error)
- type Author
- func (s *Author) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Author) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Author) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Author) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Author) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Author) IndexContent() bool
- func (s *Author) MarshalEditor() ([]byte, error)
- func (s *Author) String() string
- type CTA
- func (s *CTA) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *CTA) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *CTA) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *CTA) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *CTA) Create(res http.ResponseWriter, req *http.Request) error
- func (s *CTA) IndexContent() bool
- func (s *CTA) MarshalEditor() ([]byte, error)
- func (s *CTA) SetHash()
- func (s *CTA) String() string
- type Counter
- func (s *Counter) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Counter) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Counter) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Counter) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Counter) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Counter) IndexContent() bool
- func (s *Counter) MarshalEditor() ([]byte, error)
- func (s *Counter) SetHash()
- func (s *Counter) String() string
- type Deployment
- func (s *Deployment) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Deployment) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Deployment) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Deployment) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Deployment) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Deployment) IndexContent() bool
- func (s *Deployment) IsNewDeployment() bool
- func (s *Deployment) MarshalEditor() ([]byte, error)
- func (s *Deployment) SelectContentTypes() []string
- func (s *Deployment) SetHash()
- func (s *Deployment) SetSelectData(data map[string][][]byte)
- func (s *Deployment) String() string
- type Domain
- func (d *Domain) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *Domain) Approve(res http.ResponseWriter, req *http.Request) error
- func (d *Domain) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (d *Domain) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *Domain) Create(res http.ResponseWriter, req *http.Request) error
- func (d *Domain) FullDomain() string
- func (d *Domain) IndexContent() bool
- func (d *Domain) MarshalEditor() ([]byte, error)
- func (d *Domain) Name() string
- func (d *Domain) SetHash()
- func (d *Domain) String() string
- type File
- type Image
- func (s *Image) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Image) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Image) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Image) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Image) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Image) GetHeight() int
- func (s *Image) GetWidth() int
- func (s *Image) IndexContent() bool
- func (s *Image) ItemTags() []string
- func (s *Image) MarshalEditor() ([]byte, error)
- func (s *Image) SetMeta(service content.DirService) error
- func (s *Image) String() string
- type Index
- type Instance
- func (l *Instance) Approve(res http.ResponseWriter, req *http.Request) error
- func (l *Instance) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (l *Instance) Create(res http.ResponseWriter, req *http.Request) error
- func (l *Instance) IndexContent() bool
- func (l *Instance) ItemHash() string
- func (l *Instance) ItemSlug() string
- func (l *Instance) MarshalEditor() ([]byte, error)
- func (l *Instance) SetHash()
- func (l *Instance) SetSlug(slug string)
- func (l *Instance) String() string
- type InstanceStatus
- type Item
- func (i *Item) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAPIDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) error
- func (i *Item) AfterAPIUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminCreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterAdminUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterApprove(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterDisable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterEnable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterReject(res http.ResponseWriter, req *http.Request) error
- func (i *Item) AfterSave(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPIDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) ([]byte, error)
- func (i *Item) BeforeAPIUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminCreate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeAdminUpdate(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeApprove(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeDelete(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeDisable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeEnable(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeReject(res http.ResponseWriter, req *http.Request) error
- func (i *Item) BeforeSave(res http.ResponseWriter, req *http.Request) error
- func (i *Item) IndexContent() bool
- func (i *Item) ItemHash() string
- func (i *Item) ItemID() int
- func (i *Item) ItemName() string
- func (i *Item) ItemSlug() string
- func (i *Item) ItemStatus() content.Status
- func (i *Item) QueryString() string
- func (i *Item) SearchMapping() (*mapping.IndexMappingImpl, error)
- func (i *Item) SetItemID(id int)
- func (i *Item) SetItemStatus(status content.Status)
- func (i *Item) SetSlug(slug string)
- func (i *Item) SetUniqueID(uuid uuid.UUID)
- func (i *Item) String() string
- func (i *Item) Time() int64
- func (i *Item) Touch() int64
- func (i *Item) UniqueID() uuid.UUID
- func (i *Item) UpdateTime() time.Time
- type Language
- type License
- func (l *License) Approve(res http.ResponseWriter, req *http.Request) error
- func (l *License) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (l *License) CanAddDevice() bool
- func (l *License) CanAddIP() bool
- func (l *License) Create(res http.ResponseWriter, req *http.Request) error
- func (l *License) GetFeatures() *LicenseFeatures
- func (l *License) IndexContent() bool
- func (l *License) IsExpired() bool
- func (l *License) IsValid() bool
- func (l *License) ItemHash() string
- func (l *License) ItemSlug() string
- func (l *License) MarshalEditor() ([]byte, error)
- func (l *License) SetHash()
- func (l *License) SetSlug(slug string)
- func (l *License) String() string
- func (l *License) ToEmail() string
- func (l *License) ToPassword() string
- func (l *License) ToUserDir() string
- func (l *License) ToUserShortDir() string
- type LicenseDevice
- func (d *LicenseDevice) Approve(res http.ResponseWriter, req *http.Request) error
- func (d *LicenseDevice) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (d *LicenseDevice) Create(res http.ResponseWriter, req *http.Request) error
- func (d *LicenseDevice) IndexContent() bool
- func (d *LicenseDevice) ItemHash() string
- func (d *LicenseDevice) ItemSlug() string
- func (d *LicenseDevice) MarshalEditor() ([]byte, error)
- func (d *LicenseDevice) SetHash()
- func (d *LicenseDevice) SetSlug(slug string)
- func (d *LicenseDevice) String() string
- type LicenseFeatures
- type LicenseIP
- func (i *LicenseIP) Approve(res http.ResponseWriter, req *http.Request) error
- func (i *LicenseIP) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (i *LicenseIP) Create(res http.ResponseWriter, req *http.Request) error
- func (i *LicenseIP) IndexContent() bool
- func (i *LicenseIP) ItemHash() string
- func (i *LicenseIP) ItemSlug() string
- func (i *LicenseIP) MarshalEditor() ([]byte, error)
- func (i *LicenseIP) SetHash()
- func (i *LicenseIP) SetSlug(slug string)
- func (i *LicenseIP) String() string
- type LicensePlan
- type LicenseTrial
- func (t *LicenseTrial) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (t *LicenseTrial) Approve(res http.ResponseWriter, req *http.Request) error
- func (t *LicenseTrial) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (t *LicenseTrial) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (t *LicenseTrial) Create(res http.ResponseWriter, req *http.Request) error
- func (t *LicenseTrial) IndexContent() bool
- func (t *LicenseTrial) ItemHash() string
- func (t *LicenseTrial) ItemSlug() string
- func (t *LicenseTrial) MarshalEditor() ([]byte, error)
- func (t *LicenseTrial) Name() string
- func (t *LicenseTrial) SetHash()
- func (t *LicenseTrial) SetSlug(slug string)
- func (t *LicenseTrial) String() string
- type LicenseUsage
- func (u *LicenseUsage) Approve(res http.ResponseWriter, req *http.Request) error
- func (u *LicenseUsage) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (u *LicenseUsage) Create(res http.ResponseWriter, req *http.Request) error
- func (u *LicenseUsage) GetPublishDiskUsageMB() float64
- func (u *LicenseUsage) GetSyncDiskUsageMB() float64
- func (u *LicenseUsage) GetTotalDiskUsage() int64
- func (u *LicenseUsage) GetTotalDiskUsageMB() float64
- func (u *LicenseUsage) IndexContent() bool
- func (u *LicenseUsage) ItemHash() string
- func (u *LicenseUsage) ItemSlug() string
- func (u *LicenseUsage) MarshalEditor() ([]byte, error)
- func (u *LicenseUsage) SetHash()
- func (u *LicenseUsage) SetSlug(slug string)
- func (u *LicenseUsage) String() string
- type MDFPreview
- func (s *MDFPreview) AbsAssetPath(uploadDir string) (string, error)
- func (s *MDFPreview) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *MDFPreview) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *MDFPreview) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *MDFPreview) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *MDFPreview) Create(res http.ResponseWriter, req *http.Request) error
- func (s *MDFPreview) Deploy() bool
- func (s *MDFPreview) IndexContent() bool
- func (s *MDFPreview) MarshalEditor() ([]byte, error)
- func (s *MDFPreview) SetHash()
- func (s *MDFPreview) String() string
- type Post
- func (s *Post) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Post) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Post) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Post) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Post) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Post) FrontMatter() string
- func (s *Post) FullContent() string
- func (s *Post) IndexContent() bool
- func (s *Post) Markdown() ([]byte, error)
- func (s *Post) MarshalEditor() ([]byte, error)
- func (s *Post) Push(http.ResponseWriter, *http.Request) ([]string, error)
- func (s *Post) SetHash()
- func (s *Post) String() string
- type Preview
- func (s *Preview) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Preview) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Preview) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Preview) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Preview) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Preview) IndexContent() bool
- func (s *Preview) MarshalEditor() ([]byte, error)
- func (s *Preview) SelectContentTypes() []string
- func (s *Preview) SetHash()
- func (s *Preview) SetSelectData(data map[string][][]byte)
- func (s *Preview) String() string
- type PublishDomain
- func (d *PublishDomain) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *PublishDomain) Approve(res http.ResponseWriter, req *http.Request) error
- func (d *PublishDomain) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (d *PublishDomain) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *PublishDomain) Create(res http.ResponseWriter, req *http.Request) error
- func (d *PublishDomain) IndexContent() bool
- func (d *PublishDomain) ItemHash() string
- func (d *PublishDomain) ItemSlug() string
- func (d *PublishDomain) MarshalEditor() ([]byte, error)
- func (d *PublishDomain) SetHash()
- func (d *PublishDomain) SetSlug(slug string)
- func (d *PublishDomain) String() string
- type PublishSite
- func (p *PublishSite) AbsAssetPath(uploadDir string) (string, error)
- func (p *PublishSite) Deploy() bool
- func (p *PublishSite) IndexContent() bool
- func (p *PublishSite) IsActive() bool
- func (p *PublishSite) MarshalEditor() ([]byte, error)
- func (p *PublishSite) SetHash()
- func (p *PublishSite) SetSlug(slug string)
- func (p *PublishSite) String() string
- type PublishUsage
- func (u *PublishUsage) CanAddSite() bool
- func (u *PublishUsage) IndexContent() bool
- func (u *PublishUsage) IsStorageOverQuota() bool
- func (u *PublishUsage) MarshalEditor() ([]byte, error)
- func (u *PublishUsage) SetHash()
- func (u *PublishUsage) SetSlug(slug string)
- func (u *PublishUsage) StoragePercentage() float64
- func (u *PublishUsage) String() string
- type Resource
- func (s *Resource) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Resource) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Resource) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Resource) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Resource) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Resource) IndexContent() bool
- func (s *Resource) MarshalEditor() ([]byte, error)
- func (s *Resource) SetHash()
- func (s *Resource) String() string
- type ShortCode
- func (s *ShortCode) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *ShortCode) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *ShortCode) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *ShortCode) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *ShortCode) Create(res http.ResponseWriter, req *http.Request) error
- func (s *ShortCode) GetHeight() int
- func (s *ShortCode) GetWidth() int
- func (s *ShortCode) IndexContent() bool
- func (s *ShortCode) ItemTags() []string
- func (s *ShortCode) MarshalEditor() ([]byte, error)
- func (s *ShortCode) SetHash()
- func (s *ShortCode) SetMeta(service content.DirService) error
- func (s *ShortCode) String() string
- type Site
- func (s *Site) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Site) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Site) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Site) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Site) Build() bool
- func (s *Site) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Site) Deploy() bool
- func (s *Site) HasMenus() bool
- func (s *Site) IndexContent() bool
- func (s *Site) IsMultiLanguages() bool
- func (s *Site) MarshalEditor() ([]byte, error)
- func (s *Site) String() string
- func (s *Site) Toml() ([]byte, error)
- func (s *Site) UnmarshalJSON(data []byte) error
- func (s *Site) Update(res http.ResponseWriter, req *http.Request) error
- type SiteLanguage
- func (s *SiteLanguage) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SiteLanguage) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *SiteLanguage) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *SiteLanguage) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SiteLanguage) Create(res http.ResponseWriter, req *http.Request) error
- func (s *SiteLanguage) IndexContent() bool
- func (s *SiteLanguage) MarshalEditor() ([]byte, error)
- func (s *SiteLanguage) SelectContentTypes() []string
- func (s *SiteLanguage) SetSelectData(data map[string][][]byte)
- func (s *SiteLanguage) String() string
- type SitePost
- func (s *SitePost) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SitePost) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *SitePost) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *SitePost) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SitePost) Create(res http.ResponseWriter, req *http.Request) error
- func (s *SitePost) IndexContent() bool
- func (s *SitePost) MarshalEditor() ([]byte, error)
- func (s *SitePost) SelectContentTypes() []string
- func (s *SitePost) SetSelectData(data map[string][][]byte)
- func (s *SitePost) String() string
- type SiteResource
- func (s *SiteResource) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SiteResource) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *SiteResource) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *SiteResource) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *SiteResource) Create(res http.ResponseWriter, req *http.Request) error
- func (s *SiteResource) IndexContent() bool
- func (s *SiteResource) MarshalEditor() ([]byte, error)
- func (s *SiteResource) SelectContentTypes() []string
- func (s *SiteResource) SetSelectData(data map[string][][]byte)
- func (s *SiteResource) String() string
- type SortableContent
- type SubDomain
- func (d *SubDomain) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *SubDomain) Approve(res http.ResponseWriter, req *http.Request) error
- func (d *SubDomain) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (d *SubDomain) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (d *SubDomain) Create(res http.ResponseWriter, req *http.Request) error
- func (d *SubDomain) IndexContent() bool
- func (d *SubDomain) ItemHash() string
- func (d *SubDomain) ItemSlug() string
- func (d *SubDomain) MarshalEditor() ([]byte, error)
- func (d *SubDomain) Name() string
- func (d *SubDomain) SetHash()
- func (d *SubDomain) SetSlug(slug string)
- func (d *SubDomain) String() string
- type SyncAccount
- func (s *SyncAccount) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *SyncAccount) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *SyncAccount) Create(res http.ResponseWriter, req *http.Request) error
- func (s *SyncAccount) IndexContent() bool
- func (s *SyncAccount) ItemHash() string
- func (s *SyncAccount) ItemSlug() string
- func (s *SyncAccount) MarshalEditor() ([]byte, error)
- func (s *SyncAccount) SetHash()
- func (s *SyncAccount) SetSlug(slug string)
- func (s *SyncAccount) String() string
- type SyncUsage
- type Theme
- func (s *Theme) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Theme) Approve(res http.ResponseWriter, req *http.Request) error
- func (s *Theme) AutoApprove(res http.ResponseWriter, req *http.Request) error
- func (s *Theme) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
- func (s *Theme) Create(res http.ResponseWriter, req *http.Request) error
- func (s *Theme) IndexContent() bool
- func (s *Theme) ItemTags() []string
- func (s *Theme) MarshalEditor() ([]byte, error)
- func (s *Theme) SetHash()
- func (s *Theme) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIdFromQueryString ¶
func Slug ¶
func Slug(i content.Identifiable) (string, error)
Slug returns a URL friendly string from the title of a post item
func StringToSlug ¶
Types ¶
type Author ¶
type Author struct {
Item
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
SiteURL string `json:"site_url"`
Avatar string `json:"avatar"`
}
func (*Author) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Author) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Author) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Author) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Author) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Author) IndexContent ¶
func (*Author) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type CTA ¶ added in v0.2.1
func (*CTA) AfterAPICreate ¶ added in v0.2.1
func (*CTA) AutoApprove ¶ added in v0.2.1
func (*CTA) BeforeAPICreate ¶ added in v0.2.1
func (*CTA) IndexContent ¶ added in v0.2.1
func (*CTA) MarshalEditor ¶ added in v0.2.1
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Counter ¶ added in v0.2.2
func (*Counter) AfterAPICreate ¶ added in v0.2.2
func (*Counter) AutoApprove ¶ added in v0.2.2
func (*Counter) BeforeAPICreate ¶ added in v0.2.2
func (*Counter) IndexContent ¶ added in v0.2.2
func (*Counter) MarshalEditor ¶ added in v0.2.2
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Deployment ¶
type Deployment struct {
Item
Domain string `json:"domain"`
SiteID string `json:"site_id"`
SiteName string `json:"site_name"`
SitePath string `json:"site_path"`
HostName string `json:"host_name"`
Status string `json:"status"`
// contains filtered or unexported fields
}
func (*Deployment) AfterAPICreate ¶
func (s *Deployment) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Deployment) Approve ¶
func (s *Deployment) Approve(res http.ResponseWriter, req *http.Request) error
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Deployment) AutoApprove ¶
func (s *Deployment) AutoApprove(res http.ResponseWriter, req *http.Request) error
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Deployment) BeforeAPICreate ¶
func (s *Deployment) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Deployment) Create ¶
func (s *Deployment) Create(res http.ResponseWriter, req *http.Request) error
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Deployment) IndexContent ¶
func (s *Deployment) IndexContent() bool
func (*Deployment) IsNewDeployment ¶
func (s *Deployment) IsNewDeployment() bool
func (*Deployment) MarshalEditor ¶
func (s *Deployment) MarshalEditor() ([]byte, error)
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*Deployment) SelectContentTypes ¶
func (s *Deployment) SelectContentTypes() []string
func (*Deployment) SetHash ¶
func (s *Deployment) SetHash()
func (*Deployment) SetSelectData ¶
func (s *Deployment) SetSelectData(data map[string][][]byte)
func (*Deployment) String ¶
func (s *Deployment) String() string
String defines the display name of a Song in the CMS list-view
type Domain ¶
type Domain struct {
Item
Root string `json:"root"`
Sub string `json:"sub"`
Owner string `json:"owner"`
}
func (*Domain) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Domain) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Domain) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Domain) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Domain) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Domain) FullDomain ¶
func (*Domain) IndexContent ¶
func (*Domain) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Image ¶ added in v0.1.27
type Image struct {
Item
Name string `json:"name"`
Desc string `json:"desc"`
Tags []string `json:"tags"`
Asset string `json:"asset"`
Width int `json:"width"`
Height int `json:"height"`
}
func (*Image) AfterAPICreate ¶ added in v0.1.27
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Image) Approve ¶ added in v0.1.27
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Image) AutoApprove ¶ added in v0.1.27
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Image) BeforeAPICreate ¶ added in v0.1.27
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Image) Create ¶ added in v0.1.27
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Image) IndexContent ¶ added in v0.1.27
func (*Image) MarshalEditor ¶ added in v0.1.27
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
func CreateIndex ¶
func (*Index) ContentType ¶
type Instance ¶ added in v0.2.47
type Instance struct {
Item
// 唯一标识
InstanceID string `json:"instance_id"` // SHA256(machine_id + salt)
Domain string `json:"domain"` // 实例域名
// 总体统计
TotalLicenses int `json:"total_licenses"`
TotalTrials int `json:"total_trials"`
// 基本信息(用于管理)
Version string `json:"version"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
// 状态控制(核心)
Status InstanceStatus `json:"status"` // active / blocked / suspended
// 心跳信息
LastSeenAt int64 `json:"last_seen_at"`
CreatedAt int64 `json:"created_at"`
// 控制策略(可选扩展)
AllowOfflineSeconds int64 `json:"allow_offline_seconds"` // 允许离线多久
}
func (*Instance) AutoApprove ¶ added in v0.2.47
func (*Instance) IndexContent ¶ added in v0.2.47
IndexContent 标记此类型需要被索引
func (*Instance) MarshalEditor ¶ added in v0.2.47
MarshalEditor 实现 editor.Editable 接口
func (*Instance) SetHash ¶ added in v0.2.47
func (l *Instance) SetHash()
SetHash 使用 LicenseKey 的 MD5 作为 hash,用于快速查找 存入 __contentIndex["license:{hash}"] → ID
type InstanceStatus ¶ added in v0.2.47
type InstanceStatus string
const ( InstanceActive InstanceStatus = "active" InstanceBlocked InstanceStatus = "blocked" // ❌ 直接禁用 InstanceSuspended InstanceStatus = "suspended" // ⚠️ 降级 )
type Item ¶
type Item struct {
UUID uuid.UUID `json:"uuid"`
Status content.Status `json:"status"`
Namespace string `json:"namespace"`
ID int `json:"id"`
Slug string `json:"slug"`
Hash string `json:"hash"`
Timestamp int64 `json:"timestamp"`
Updated int64 `json:"updated"`
}
Item should only be embedded into content type structs.
func NewItemWithNamespace ¶
func (*Item) AfterAPICreate ¶
AfterAPICreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIDelete ¶
AfterAPIDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIResponse ¶
AfterAPIResponse is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAPIUpdate ¶
AfterAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminCreate ¶
AfterAdminCreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminDelete ¶
AfterAdminDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterAdminUpdate ¶
AfterAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterApprove ¶
AfterApprove is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterDelete ¶
AfterDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterDisable ¶
AfterDisable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterEnable ¶
AfterEnable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterReject ¶
AfterReject is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) AfterSave ¶
AfterSave is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPICreate ¶
BeforeAPICreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIDelete ¶
BeforeAPIDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIResponse ¶
func (i *Item) BeforeAPIResponse(res http.ResponseWriter, req *http.Request, data []byte) ([]byte, error)
BeforeAPIResponse is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAPIUpdate ¶
BeforeAPIUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminCreate ¶
BeforeAdminCreate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminDelete ¶
BeforeAdminDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeAdminUpdate ¶
BeforeAdminUpdate is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeApprove ¶
BeforeApprove is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeDelete ¶
BeforeDelete is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeDisable ¶
BeforeDisable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeEnable ¶
BeforeEnable is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeReject ¶
BeforeReject is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) BeforeSave ¶
BeforeSave is a no-op to ensure structs which embed *Item implement Hookable
func (*Item) IndexContent ¶
IndexContent determines if a type should be indexed for searching partially implements search.Searchable
func (*Item) ItemID ¶
ItemID gets the *Item's ID field partially implements the Identifiable interface
func (*Item) ItemName ¶
ItemName gets the *Item's Namespace field partially implements the Identifiable interface
func (*Item) ItemStatus ¶
ItemStatus gets the *Item's Status field partially implements the Identifiable interface
func (*Item) QueryString ¶
func (*Item) SearchMapping ¶
func (i *Item) SearchMapping() (*mapping.IndexMappingImpl, error)
SearchMapping returns a default implementation of a Bleve IndexMappingImpl partially implements search.Searchable
func (*Item) SetItemID ¶
SetItemID sets the *Item's ID field partially implements the Identifiable interface
func (*Item) SetItemStatus ¶
SetItemStatus sets the *Item's Status field partially implements the Identifiable interface
func (*Item) SetUniqueID ¶
func (*Item) String ¶
String formats an *Item into a printable value partially implements the Identifiable interface
func (*Item) UniqueID ¶
UniqueID gets the *Item's UUID field partially implements the Identifiable interface
func (*Item) UpdateTime ¶
type Language ¶
func (*Language) IndexContent ¶
func (*Language) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Artist within the CMS and implements editor.Editable
type License ¶ added in v0.2.3
type License struct {
Item
LicenseKey string `json:"license_key"` // MDF-XXXX-XXXX-XXXX
Plan LicensePlan `json:"plan"`
// 有效期
IssueDate int64 `json:"issue_date"`
ExpiryDate int64 `json:"expiry_date"`
// 激活状态
Activated bool `json:"activated"`
ActivatedAt int64 `json:"activated_at"`
// 设备/IP 限制 (治理用)
MaxDevices int `json:"max_devices"` // 最大设备数,默认 3
MaxIPs int `json:"max_ips"` // 最大 IP 数,默认 3
CurrentDevices int `json:"current_devices"` // 当前设备数
CurrentIPs int `json:"current_ips"` // 当前 IP 数
// Sync 功能
SyncEnabled bool `json:"sync_enabled"`
SyncQuotaMB int `json:"sync_quota"`
// Publish 功能
PublishEnabled bool `json:"publish_enabled"`
MaxSites int `json:"max_sites"`
MaxStorageMB int `json:"max_storage"`
CustomDomain bool `json:"custom_domain"`
CustomSubDomain bool `json:"custom_sub_domain"` // 二级域名
}
License 作为 Content ValueObject,管理用户许可证
func (*License) AutoApprove ¶ added in v0.2.3
func (*License) CanAddDevice ¶ added in v0.2.3
CanAddDevice 检查是否可以添加新设备
func (*License) GetFeatures ¶ added in v0.2.3
func (l *License) GetFeatures() *LicenseFeatures
GetFeatures 获取当前套餐的功能特性
func (*License) IndexContent ¶ added in v0.2.3
IndexContent 标记此类型需要被索引
func (*License) MarshalEditor ¶ added in v0.2.3
MarshalEditor 实现 editor.Editable 接口
func (*License) SetHash ¶ added in v0.2.3
func (l *License) SetHash()
SetHash 使用 LicenseKey 的 MD5 作为 hash,用于快速查找 存入 __contentIndex["license:{hash}"] → ID
func (*License) ToEmail ¶ added in v0.2.3
ToEmail 将 LicenseKey 转换为用户邮箱 例如: MDF-ABCD-EFGH-JKLM → abcd-efgh-jklm@mdfriday.com
func (*License) ToPassword ¶ added in v0.2.3
ToPassword 将 LicenseKey 转换为密码 (base64 编码)
func (*License) ToUserShortDir ¶ added in v0.2.42
type LicenseDevice ¶ added in v0.2.3
type LicenseDevice struct {
Item
License string `json:"license"` // 关联的 License Key
DeviceID string `json:"device_id"` // 设备唯一标识
DeviceName string `json:"device_name"` // 设备名称 (UA/OS 等)
DeviceType string `json:"device_type"` // desktop / mobile / tablet
// 使用信息
FirstSeenAt int64 `json:"first_seen_at"` // 首次使用时间
LastSeenAt int64 `json:"last_seen_at"` // 最后使用时间
AccessCount int `json:"access_count"` // 访问次数
// 状态
Status string `json:"status"` // active / blocked
}
LicenseDevice 设备记录表 (治理用) BoltDB 存储: licensedevice / licensedevice__index Hash: MD5(License:DeviceID) | Slug: {License}:{DeviceID[:8]}
func (*LicenseDevice) Approve ¶ added in v0.2.3
func (d *LicenseDevice) Approve(res http.ResponseWriter, req *http.Request) error
func (*LicenseDevice) AutoApprove ¶ added in v0.2.3
func (d *LicenseDevice) AutoApprove(res http.ResponseWriter, req *http.Request) error
func (*LicenseDevice) Create ¶ added in v0.2.3
func (d *LicenseDevice) Create(res http.ResponseWriter, req *http.Request) error
func (*LicenseDevice) IndexContent ¶ added in v0.2.3
func (d *LicenseDevice) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*LicenseDevice) ItemHash ¶ added in v0.2.3
func (d *LicenseDevice) ItemHash() string
func (*LicenseDevice) ItemSlug ¶ added in v0.2.3
func (d *LicenseDevice) ItemSlug() string
func (*LicenseDevice) MarshalEditor ¶ added in v0.2.3
func (d *LicenseDevice) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*LicenseDevice) SetHash ¶ added in v0.2.3
func (d *LicenseDevice) SetHash()
SetHash 使用 License + DeviceID 的组合 hash 存入 __contentIndex["licensedevice:{hash}"] → ID
func (*LicenseDevice) SetSlug ¶ added in v0.2.3
func (d *LicenseDevice) SetSlug(slug string)
SetSlug 使用 "License:DeviceID[:8]" 格式,支持按 License 前缀查询
func (*LicenseDevice) String ¶ added in v0.2.3
func (d *LicenseDevice) String() string
String 定义在 CMS 列表中的显示名称
type LicenseFeatures ¶ added in v0.2.3
type LicenseFeatures struct {
// 设备/IP 限制
MaxDevices int `json:"max_devices"`
MaxIPs int `json:"max_ips"`
// Sync 功能
SyncEnabled bool `json:"sync_enabled"`
SyncQuotaMB int `json:"sync_quota"`
// Publish 功能
PublishEnabled bool `json:"publish_enabled"`
MaxSites int `json:"max_sites"`
MaxStorageMB int `json:"max_storage"`
CustomDomain bool `json:"custom_domain"`
CustomSubDomain bool `json:"custom_sub_domain"` // 二级域名
// 有效期(天数)
ValidityDays int `json:"validity_days"`
}
LicenseFeatures 定义各套餐的功能特性
func GetPlanFeatures ¶ added in v0.2.3
func GetPlanFeatures(plan LicensePlan) *LicenseFeatures
GetPlanFeatures 根据套餐类型获取功能特性
type LicenseIP ¶ added in v0.2.3
type LicenseIP struct {
Item
License string `json:"license"` // 关联的 License Key
IPAddress string `json:"ip_address"` // IP 地址
// 地理位置信息 (可选)
Country string `json:"country"`
Region string `json:"region"`
City string `json:"city"`
// 使用信息
FirstSeenAt int64 `json:"first_seen_at"` // 首次使用时间
LastSeenAt int64 `json:"last_seen_at"` // 最后使用时间
AccessCount int `json:"access_count"` // 访问次数
// 状态
Status string `json:"status"` // active / blocked
}
LicenseIP IP 记录表 (治理用) BoltDB 存储: licenseip / licenseip__index Hash: MD5(License:IPAddress) | Slug: {License}:{IPAddress}
func (*LicenseIP) AutoApprove ¶ added in v0.2.3
func (*LicenseIP) IndexContent ¶ added in v0.2.3
IndexContent 标记此类型需要被索引
func (*LicenseIP) MarshalEditor ¶ added in v0.2.3
MarshalEditor 实现 editor.Editable 接口
func (*LicenseIP) SetHash ¶ added in v0.2.3
func (i *LicenseIP) SetHash()
SetHash 使用 License + IPAddress 的组合 hash 存入 __contentIndex["licenseip:{hash}"] → ID
type LicensePlan ¶ added in v0.2.3
type LicensePlan string
LicensePlan 定义许可证套餐类型
const ( PlanFree LicensePlan = "free" PlanStarter LicensePlan = "starter" PlanEnjoy LicensePlan = "enjoy" PlanCreator LicensePlan = "creator" PlanPro LicensePlan = "pro" PlanEnterprise LicensePlan = "enterprise" )
type LicenseTrial ¶ added in v0.2.30
type LicenseTrial struct {
Item
Email string `json:"email"` // 申请邮箱(唯一标识)
License string `json:"license"` // 生成的 License Key
}
LicenseTrial 记录试用 License 申请信息 一个邮箱只能申请一次试用码
func (*LicenseTrial) AfterAPICreate ¶ added in v0.2.30
func (t *LicenseTrial) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
func (*LicenseTrial) Approve ¶ added in v0.2.30
func (t *LicenseTrial) Approve(res http.ResponseWriter, req *http.Request) error
func (*LicenseTrial) AutoApprove ¶ added in v0.2.30
func (t *LicenseTrial) AutoApprove(res http.ResponseWriter, req *http.Request) error
func (*LicenseTrial) BeforeAPICreate ¶ added in v0.2.30
func (t *LicenseTrial) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
func (*LicenseTrial) Create ¶ added in v0.2.30
func (t *LicenseTrial) Create(res http.ResponseWriter, req *http.Request) error
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the LicenseTrial struct fields, and is multipart encoded
func (*LicenseTrial) IndexContent ¶ added in v0.2.30
func (t *LicenseTrial) IndexContent() bool
func (*LicenseTrial) ItemHash ¶ added in v0.2.30
func (t *LicenseTrial) ItemHash() string
func (*LicenseTrial) ItemSlug ¶ added in v0.2.30
func (t *LicenseTrial) ItemSlug() string
func (*LicenseTrial) MarshalEditor ¶ added in v0.2.30
func (t *LicenseTrial) MarshalEditor() ([]byte, error)
MarshalEditor writes a buffer of html to edit a LicenseTrial within the CMS and implements editor.Editable
func (*LicenseTrial) Name ¶ added in v0.2.30
func (t *LicenseTrial) Name() string
func (*LicenseTrial) SetHash ¶ added in v0.2.30
func (t *LicenseTrial) SetHash()
SetHash 使用 email 作为 hash key
func (*LicenseTrial) SetSlug ¶ added in v0.2.30
func (t *LicenseTrial) SetSlug(slug string)
SetSlug 使用 email 作为 slug
func (*LicenseTrial) String ¶ added in v0.2.30
func (t *LicenseTrial) String() string
String defines the display name of a LicenseTrial in the CMS list-view
type LicenseUsage ¶ added in v0.2.5
type LicenseUsage struct {
Item
LicenseKey string `json:"license_key"` // 关联的 License Key
// 当前使用量
CurrentIPs int `json:"current_ips"` // 当前 IP 使用量
CurrentDevices int `json:"current_devices"` // 当前设备使用量
// 磁盘使用量 (单位: mb)
SyncDiskUsage int64 `json:"sync_disk_usage"` // Sync 磁盘使用量
PublishDiskUsage int64 `json:"publish_disk_usage"` // Publish 磁盘使用量
// 更新时间
LastUpdatedAt int64 `json:"last_updated_at"` // 最后更新时间
}
LicenseUsage 许可证使用统计 (治理用) BoltDB 存储: licenseusage / licenseusage__index Hash: MD5(LicenseKey) | Slug: {LicenseKey}
func (*LicenseUsage) Approve ¶ added in v0.2.5
func (u *LicenseUsage) Approve(res http.ResponseWriter, req *http.Request) error
func (*LicenseUsage) AutoApprove ¶ added in v0.2.5
func (u *LicenseUsage) AutoApprove(res http.ResponseWriter, req *http.Request) error
func (*LicenseUsage) Create ¶ added in v0.2.5
func (u *LicenseUsage) Create(res http.ResponseWriter, req *http.Request) error
func (*LicenseUsage) GetPublishDiskUsageMB ¶ added in v0.2.5
func (u *LicenseUsage) GetPublishDiskUsageMB() float64
GetPublishDiskUsageMB 获取 Publish 磁盘使用量 (MB)
func (*LicenseUsage) GetSyncDiskUsageMB ¶ added in v0.2.5
func (u *LicenseUsage) GetSyncDiskUsageMB() float64
GetSyncDiskUsageMB 获取 Sync 磁盘使用量 (MB)
func (*LicenseUsage) GetTotalDiskUsage ¶ added in v0.2.5
func (u *LicenseUsage) GetTotalDiskUsage() int64
GetTotalDiskUsage 获取总磁盘使用量 (bytes)
func (*LicenseUsage) GetTotalDiskUsageMB ¶ added in v0.2.5
func (u *LicenseUsage) GetTotalDiskUsageMB() float64
GetTotalDiskUsageMB 获取总磁盘使用量 (MB)
func (*LicenseUsage) IndexContent ¶ added in v0.2.5
func (u *LicenseUsage) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*LicenseUsage) ItemHash ¶ added in v0.2.5
func (u *LicenseUsage) ItemHash() string
func (*LicenseUsage) ItemSlug ¶ added in v0.2.5
func (u *LicenseUsage) ItemSlug() string
func (*LicenseUsage) MarshalEditor ¶ added in v0.2.5
func (u *LicenseUsage) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*LicenseUsage) SetHash ¶ added in v0.2.5
func (u *LicenseUsage) SetHash()
SetHash 使用 LicenseKey 的 MD5 作为 hash,用于快速查找 存入 __contentIndex["licenseusage:{hash}"] → ID
func (*LicenseUsage) SetSlug ¶ added in v0.2.5
func (u *LicenseUsage) SetSlug(slug string)
SetSlug 使用 LicenseKey 作为 slug,存入 ns__index bucket
func (*LicenseUsage) String ¶ added in v0.2.5
func (u *LicenseUsage) String() string
String 定义在 CMS 列表中的显示名称
type MDFPreview ¶ added in v0.2.1
type MDFPreview struct {
Item
Name string `json:"name"`
Type string `json:"type"`
Path string `json:"path"`
Asset string `json:"asset"`
Size string `json:"size"`
}
func (*MDFPreview) AbsAssetPath ¶ added in v0.2.1
func (s *MDFPreview) AbsAssetPath(uploadDir string) (string, error)
func (*MDFPreview) AfterAPICreate ¶ added in v0.2.1
func (s *MDFPreview) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*MDFPreview) Approve ¶ added in v0.2.1
func (s *MDFPreview) Approve(res http.ResponseWriter, req *http.Request) error
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*MDFPreview) AutoApprove ¶ added in v0.2.1
func (s *MDFPreview) AutoApprove(res http.ResponseWriter, req *http.Request) error
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*MDFPreview) BeforeAPICreate ¶ added in v0.2.1
func (s *MDFPreview) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*MDFPreview) Create ¶ added in v0.2.1
func (s *MDFPreview) Create(res http.ResponseWriter, req *http.Request) error
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*MDFPreview) Deploy ¶ added in v0.2.1
func (s *MDFPreview) Deploy() bool
func (*MDFPreview) IndexContent ¶ added in v0.2.1
func (s *MDFPreview) IndexContent() bool
func (*MDFPreview) MarshalEditor ¶ added in v0.2.1
func (s *MDFPreview) MarshalEditor() ([]byte, error)
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*MDFPreview) SetHash ¶ added in v0.2.1
func (s *MDFPreview) SetHash()
func (*MDFPreview) String ¶ added in v0.2.1
func (s *MDFPreview) String() string
String defines the display name of a Song in the CMS list-view
type Post ¶
type Post struct {
Item
Title string `json:"title"`
Content string `json:"content"`
Author string `json:"author"`
Params string `json:"params"`
Assets []string `json:"assets"`
}
func (*Post) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Post) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Post) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Post) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Post) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Post) FrontMatter ¶
func (*Post) FullContent ¶
func (*Post) IndexContent ¶
func (*Post) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Preview ¶
type Preview struct {
Item
Domain string `json:"domain"`
SiteID string `json:"site_id"`
SiteName string `json:"site_name"`
SitePath string `json:"site_path"`
HostName string `json:"host_name"`
Status string `json:"status"`
// contains filtered or unexported fields
}
func (*Preview) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Preview) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Preview) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Preview) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Preview) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Preview) IndexContent ¶
func (*Preview) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*Preview) SelectContentTypes ¶
func (*Preview) SetSelectData ¶
type PublishDomain ¶ added in v0.2.3
type PublishDomain struct {
Item
License string `json:"license"` // 关联的 License Key
Folder string `json:"folder"` // 关联的用户文件夹
SubDomain string `json:"sub_domain"` // 关联的子域名
CusDomain string `json:"cus_domain"` // 关联的自定义域名
}
func (*PublishDomain) AfterAPICreate ¶ added in v0.2.18
func (d *PublishDomain) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
func (*PublishDomain) Approve ¶ added in v0.2.3
func (d *PublishDomain) Approve(res http.ResponseWriter, req *http.Request) error
func (*PublishDomain) AutoApprove ¶ added in v0.2.3
func (d *PublishDomain) AutoApprove(res http.ResponseWriter, req *http.Request) error
func (*PublishDomain) BeforeAPICreate ¶ added in v0.2.18
func (d *PublishDomain) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
func (*PublishDomain) Create ¶ added in v0.2.18
func (d *PublishDomain) Create(res http.ResponseWriter, req *http.Request) error
func (*PublishDomain) IndexContent ¶ added in v0.2.3
func (d *PublishDomain) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*PublishDomain) ItemHash ¶ added in v0.2.3
func (d *PublishDomain) ItemHash() string
func (*PublishDomain) ItemSlug ¶ added in v0.2.3
func (d *PublishDomain) ItemSlug() string
func (*PublishDomain) MarshalEditor ¶ added in v0.2.3
func (d *PublishDomain) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*PublishDomain) SetHash ¶ added in v0.2.3
func (d *PublishDomain) SetHash()
func (*PublishDomain) SetSlug ¶ added in v0.2.3
func (d *PublishDomain) SetSlug(slug string)
func (*PublishDomain) String ¶ added in v0.2.3
func (d *PublishDomain) String() string
type PublishSite ¶ added in v0.2.3
type PublishSite struct {
Item
License string `json:"license"` // 关联的 License Key
Name string `json:"name"` // 站点名称
SiteType string `json:"site_type"` // site / article
Asset string `json:"asset"` // 资源文件路径 (zip)
Size int64 `json:"size"` // 大小 (bytes)
FolderPath string `json:"folder_path"` // 发布目录路径
PublicURL string `json:"public_url"` // 公开访问 URL
Status string `json:"status"` // pending / active / deleted
CreatedAt int64 `json:"created_at"` // 创建时间
}
PublishSite 发布站点记录 BoltDB 存储: publishsite / publishsite__index Hash: MD5(License:Name) | Slug: {License}:{Name}
func (*PublishSite) AbsAssetPath ¶ added in v0.2.3
func (p *PublishSite) AbsAssetPath(uploadDir string) (string, error)
AbsAssetPath 获取资源文件的绝对路径
func (*PublishSite) IndexContent ¶ added in v0.2.3
func (p *PublishSite) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*PublishSite) IsActive ¶ added in v0.2.3
func (p *PublishSite) IsActive() bool
IsActive 检查站点是否处于活跃状态
func (*PublishSite) MarshalEditor ¶ added in v0.2.3
func (p *PublishSite) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*PublishSite) SetHash ¶ added in v0.2.3
func (p *PublishSite) SetHash()
SetHash 使用 License + Name 的组合 hash 存入 __contentIndex["publishsite:{hash}"] → ID
func (*PublishSite) SetSlug ¶ added in v0.2.3
func (p *PublishSite) SetSlug(slug string)
SetSlug 使用 "License:Name" 格式,支持按 License 前缀查询
func (*PublishSite) String ¶ added in v0.2.3
func (p *PublishSite) String() string
String 定义在 CMS 列表中的显示名称
type PublishUsage ¶ added in v0.2.3
type PublishUsage struct {
Item
License string `json:"license"` // 关联的 License Key
SiteCount int `json:"site_count"` // 站点数量
StorageBytes int64 `json:"storage_bytes"` // 存储字节数
MaxSites int `json:"max_sites"` // 最大站点数
QuotaBytes int64 `json:"quota_bytes"` // 配额字节数
RecordedAt int64 `json:"recorded_at"` // 记录时间
}
PublishUsage Publish 容量记录 BoltDB 存储: publishusage / publishusage__index Hash: MD5(License:RecordedAt) | 用于记录历史容量
func (*PublishUsage) CanAddSite ¶ added in v0.2.3
func (u *PublishUsage) CanAddSite() bool
CanAddSite 检查是否可以添加新站点
func (*PublishUsage) IndexContent ¶ added in v0.2.3
func (u *PublishUsage) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*PublishUsage) IsStorageOverQuota ¶ added in v0.2.3
func (u *PublishUsage) IsStorageOverQuota() bool
IsStorageOverQuota 检查存储是否超出配额
func (*PublishUsage) MarshalEditor ¶ added in v0.2.3
func (u *PublishUsage) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*PublishUsage) SetHash ¶ added in v0.2.3
func (u *PublishUsage) SetHash()
SetHash 使用 License + RecordedAt 的组合 hash 存入 __contentIndex["publishusage:{hash}"] → ID
func (*PublishUsage) SetSlug ¶ added in v0.2.3
func (u *PublishUsage) SetSlug(slug string)
SetSlug 使用 "License:RecordedAt" 格式
func (*PublishUsage) StoragePercentage ¶ added in v0.2.3
func (u *PublishUsage) StoragePercentage() float64
StoragePercentage 计算存储使用百分比
func (*PublishUsage) String ¶ added in v0.2.3
func (u *PublishUsage) String() string
String 定义在 CMS 列表中的显示名称
type Resource ¶
type Resource struct {
Item
Name string `json:"name"`
Asset string `json:"asset"`
Size string `json:"size"`
}
func (*Resource) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Resource) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Resource) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Resource) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Resource) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Resource) IndexContent ¶
func (*Resource) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type ShortCode ¶ added in v0.1.48
type ShortCode struct {
Item
Name string `json:"name"`
Desc string `json:"desc"`
Template string `json:"template"`
Example string `json:"example"`
Tags []string `json:"tags"`
Asset string `json:"asset"`
Width int `json:"width"`
Height int `json:"height"`
}
func (*ShortCode) AfterAPICreate ¶ added in v0.1.48
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*ShortCode) Approve ¶ added in v0.1.48
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*ShortCode) AutoApprove ¶ added in v0.1.48
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*ShortCode) BeforeAPICreate ¶ added in v0.1.48
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*ShortCode) Create ¶ added in v0.1.48
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*ShortCode) IndexContent ¶ added in v0.1.48
func (*ShortCode) MarshalEditor ¶ added in v0.1.48
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type Site ¶
type Site struct {
Item
Title string `json:"title"`
Description string `json:"description"`
BaseURL string `json:"base_url"`
Theme string `json:"theme"`
Params string `json:"params"`
Owner string `json:"owner"`
SubDomain string `json:"sub_domain,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
GoogleAnalytics string `json:"google_analytics,omitempty"`
DefaultContentLanguage string `json:"default_content_language,omitempty"`
Languages []string `json:"languages,omitempty"`
Menus []string `json:"menus,omitempty"`
}
func (*Site) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Site) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Site) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Site) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Site) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Site) IndexContent ¶
func (*Site) IsMultiLanguages ¶
func (*Site) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*Site) UnmarshalJSON ¶
type SiteLanguage ¶
type SiteLanguage struct {
Item
Site string `json:"site"`
Language string `json:"language"`
Default bool `json:"default"`
Folder string `json:"folder"`
// contains filtered or unexported fields
}
func (*SiteLanguage) AfterAPICreate ¶
func (s *SiteLanguage) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*SiteLanguage) Approve ¶
func (s *SiteLanguage) Approve(res http.ResponseWriter, req *http.Request) error
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*SiteLanguage) AutoApprove ¶
func (s *SiteLanguage) AutoApprove(res http.ResponseWriter, req *http.Request) error
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*SiteLanguage) BeforeAPICreate ¶
func (s *SiteLanguage) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*SiteLanguage) Create ¶
func (s *SiteLanguage) Create(res http.ResponseWriter, req *http.Request) error
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*SiteLanguage) IndexContent ¶
func (s *SiteLanguage) IndexContent() bool
func (*SiteLanguage) MarshalEditor ¶
func (s *SiteLanguage) MarshalEditor() ([]byte, error)
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*SiteLanguage) SelectContentTypes ¶
func (s *SiteLanguage) SelectContentTypes() []string
func (*SiteLanguage) SetSelectData ¶
func (s *SiteLanguage) SetSelectData(data map[string][][]byte)
func (*SiteLanguage) String ¶
func (s *SiteLanguage) String() string
String defines the display name of a Song in the CMS list-view
type SitePost ¶
type SitePost struct {
Item
Site string `json:"site"`
Post string `json:"post"`
Path string `json:"path"`
// contains filtered or unexported fields
}
func (*SitePost) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*SitePost) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*SitePost) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*SitePost) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*SitePost) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*SitePost) IndexContent ¶
func (*SitePost) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*SitePost) SelectContentTypes ¶
func (*SitePost) SetSelectData ¶
type SiteResource ¶
type SiteResource struct {
Item
Site string `json:"site"`
Resource string `json:"resource"`
Path string `json:"path"`
// contains filtered or unexported fields
}
func (*SiteResource) AfterAPICreate ¶
func (s *SiteResource) AfterAPICreate(res http.ResponseWriter, req *http.Request) error
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*SiteResource) Approve ¶
func (s *SiteResource) Approve(res http.ResponseWriter, req *http.Request) error
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*SiteResource) AutoApprove ¶
func (s *SiteResource) AutoApprove(res http.ResponseWriter, req *http.Request) error
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*SiteResource) BeforeAPICreate ¶
func (s *SiteResource) BeforeAPICreate(res http.ResponseWriter, req *http.Request) error
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*SiteResource) Create ¶
func (s *SiteResource) Create(res http.ResponseWriter, req *http.Request) error
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*SiteResource) IndexContent ¶
func (s *SiteResource) IndexContent() bool
func (*SiteResource) MarshalEditor ¶
func (s *SiteResource) MarshalEditor() ([]byte, error)
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
func (*SiteResource) SelectContentTypes ¶
func (s *SiteResource) SelectContentTypes() []string
func (*SiteResource) SetSelectData ¶
func (s *SiteResource) SetSelectData(data map[string][][]byte)
func (*SiteResource) String ¶
func (s *SiteResource) String() string
String defines the display name of a Song in the CMS list-view
type SortableContent ¶
func (SortableContent) Len ¶
func (s SortableContent) Len() int
func (SortableContent) Less ¶
func (s SortableContent) Less(i, j int) bool
func (SortableContent) Swap ¶
func (s SortableContent) Swap(i, j int)
type SubDomain ¶ added in v0.2.3
func (*SubDomain) AfterAPICreate ¶ added in v0.2.3
func (*SubDomain) AutoApprove ¶ added in v0.2.3
func (*SubDomain) BeforeAPICreate ¶ added in v0.2.3
func (*SubDomain) Create ¶ added in v0.2.3
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*SubDomain) IndexContent ¶ added in v0.2.3
func (*SubDomain) MarshalEditor ¶ added in v0.2.3
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
type SyncAccount ¶ added in v0.2.3
type SyncAccount struct {
Item
License string `json:"license"` // 关联的 License Key
Email string `json:"email"` // CouchDB 用户邮箱
DBName string `json:"db_name"` // CouchDB 数据库名
DBPassword string `json:"db_password"` // CouchDB 数据库密码
DBEndpoint string `json:"db_endpoint"` // CouchDB 数据库端点 URL
Status string `json:"status"` // active / suspended
CreatedAt int64 `json:"created_at"` // 创建时间
}
SyncAccount License 对应的 CouchDB 账号 BoltDB 存储: syncaccount / syncaccount__index Hash: MD5(License) | Slug: {License}
func (*SyncAccount) Approve ¶ added in v0.2.3
func (s *SyncAccount) Approve(res http.ResponseWriter, req *http.Request) error
func (*SyncAccount) AutoApprove ¶ added in v0.2.3
func (s *SyncAccount) AutoApprove(res http.ResponseWriter, req *http.Request) error
func (*SyncAccount) Create ¶ added in v0.2.3
func (s *SyncAccount) Create(res http.ResponseWriter, req *http.Request) error
func (*SyncAccount) IndexContent ¶ added in v0.2.3
func (s *SyncAccount) IndexContent() bool
IndexContent 标记此类型需要被索引
func (*SyncAccount) ItemHash ¶ added in v0.2.3
func (s *SyncAccount) ItemHash() string
func (*SyncAccount) ItemSlug ¶ added in v0.2.3
func (s *SyncAccount) ItemSlug() string
func (*SyncAccount) MarshalEditor ¶ added in v0.2.3
func (s *SyncAccount) MarshalEditor() ([]byte, error)
MarshalEditor 实现 editor.Editable 接口
func (*SyncAccount) SetHash ¶ added in v0.2.3
func (s *SyncAccount) SetHash()
SetHash 使用 License 的 hash,一个 License 对应一个 SyncAccount 存入 __contentIndex["syncaccount:{hash}"] → ID
func (*SyncAccount) SetSlug ¶ added in v0.2.3
func (s *SyncAccount) SetSlug(slug string)
SetSlug 使用 License 作为 slug
func (*SyncAccount) String ¶ added in v0.2.3
func (s *SyncAccount) String() string
String 定义在 CMS 列表中的显示名称
type SyncUsage ¶ added in v0.2.3
type SyncUsage struct {
Item
SyncAccount string `json:"sync_account"` // 关联的 SyncAccount (License Key)
DocumentCount int `json:"document_count"` // 文档数量
StorageBytes int64 `json:"storage_bytes"` // 存储字节数
QuotaBytes int64 `json:"quota_bytes"` // 配额字节数
LastSyncAt int64 `json:"last_sync_at"` // 最后同步时间
RecordedAt int64 `json:"recorded_at"` // 记录时间
}
SyncUsage Sync 使用量记录 BoltDB 存储: syncusage / syncusage__index Hash: MD5(SyncAccount:RecordedAt) | 用于记录历史使用量
func (*SyncUsage) IndexContent ¶ added in v0.2.3
IndexContent 标记此类型需要被索引
func (*SyncUsage) IsOverQuota ¶ added in v0.2.3
IsOverQuota 检查是否超出配额
func (*SyncUsage) MarshalEditor ¶ added in v0.2.3
MarshalEditor 实现 editor.Editable 接口
func (*SyncUsage) SetHash ¶ added in v0.2.3
func (u *SyncUsage) SetHash()
SetHash 使用 SyncAccount + RecordedAt 的组合 hash 存入 __contentIndex["syncusage:{hash}"] → ID
func (*SyncUsage) UsagePercentage ¶ added in v0.2.3
UsagePercentage 计算使用百分比
type Theme ¶
type Theme struct {
Item
Name string `json:"name"`
Author string `json:"author"`
Version string `json:"version"`
Screenshot string `json:"screenshot"`
DownloadURL string `json:"download_url"`
DemoURL string `json:"demo_url"`
Tags []string `json:"tags"`
}
func (*Theme) AfterAPICreate ¶
AfterAPICreate is called after Create, and is useful for logging or triggering notifications, etc. after the data is saved to the database, etc. The request has a context containing the databse 'target' affected by the request. Ex. Song__pending:3 or Song:8 depending if Song implements api.Trustable
func (*Theme) Approve ¶
Approve implements editor.Mergeable, which enables content supplied by external clients to be approved and thus added to the public content API. Before content is approved, it is waiting in the Pending bucket, and can only be approved in the CMS if the Mergeable interface is satisfied. If not, you will not see this content show up in the CMS.
func (*Theme) AutoApprove ¶
AutoApprove implements api.Trustable, and will automatically approve content that has been submitted by an external client via api.Createable. Be careful when using AutoApprove, because content will immediately be available through your public content API. If the Trustable interface is satisfied, the AfterApprove method is bypassed. The
func (*Theme) BeforeAPICreate ¶
BeforeAPICreate is only called if the Song type implements api.Createable It is called before Create, and returning an error will cancel the request causing the system to reject the data sent in the POST
func (*Theme) Create ¶
Create implements api.Createable, and allows external POST requests from clients to add content as long as the request contains the json tag names of the Song struct fields, and is multipart encoded
func (*Theme) IndexContent ¶
func (*Theme) MarshalEditor ¶
MarshalEditor writes a buffer of html to edit a Song within the CMS and implements editor.Editable
Source Files
¶
- author.go
- counter.go
- cta.go
- deployment.go
- domain.go
- file.go
- image.go
- instance.go
- item.go
- language.go
- license.go
- licensedevice.go
- licenseip.go
- licensetrial.go
- licenseusage.go
- post.go
- preview.go
- previewmdf.go
- publishdomain.go
- publishsite.go
- publishusage.go
- resource.go
- searchindex.go
- shortcode.go
- site.go
- sitelanguage.go
- sitepost.go
- siteresource.go
- slug.go
- sort.go
- string.go
- subdomain.go
- syncaccount.go
- syncusage.go
- theme.go
- timer.go
- url.go
- util.go