Documentation
¶
Index ¶
- type BackupFile
- type BackupFiles
- type Captcha
- type CaptchaResponse
- type CmsService
- func (c *CmsService) ActivateTemplate(name string) bool
- func (c *CmsService) AddContent(content *Content) *Response
- func (c *CmsService) AddImage(name string, fileData []byte) bool
- func (c *CmsService) AddTemplate(tpl *Template) bool
- func (c *CmsService) AddTemplateFile(name string, originalFileName string, fileData []byte) bool
- func (c *CmsService) DeleteContent(name string) *Response
- func (c *CmsService) DeleteImage(name string) bool
- func (c *CmsService) DeleteTemplate(name string) bool
- func (c *CmsService) DeleteTemplateFile(namedir string) bool
- func (c *CmsService) DownloadBackups() (bool, *[]byte)
- func (c *CmsService) ExtractFile(t *TemplateFile) bool
- func (c *CmsService) GetActiveTemplateName() string
- func (c *CmsService) GetContent(name string) (bool, *Content)
- func (c *CmsService) GetContentList(published bool) *[]Content
- func (c *CmsService) GetImageList() *[]Image
- func (c *CmsService) GetImagePath(imageName string) string
- func (c *CmsService) GetNew() Service
- func (c *CmsService) GetTemplateList() *[]Template
- func (c *CmsService) HitCheck()
- func (c *CmsService) SaveHits()
- func (c *CmsService) SendCaptchaCall(cap Captcha) *CaptchaResponse
- func (c *CmsService) SendMail(mailer *ml.Mailer) bool
- func (c *CmsService) UpdateContent(content *Content) *Response
- func (c *CmsService) UploadBackups(bk *[]byte) bool
- type Content
- type Image
- type PageHead
- type Response
- type Service
- type Template
- type TemplateFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackupFile ¶
BackupFile BackupFile
type BackupFiles ¶
type BackupFiles struct {
ContentStoreFiles *[]BackupFile
TemplateStoreFiles *[]BackupFile
ImageFiles *[]BackupFile
TemplateFiles *BackupFile
}
BackupFiles BackupFiles
type Captcha ¶
type Captcha struct {
Secret string `json:"secret"`
Response string `json:"response"`
Remoteip string `json:"remoteip"`
}
Captcha Captcha
type CaptchaResponse ¶
type CaptchaResponse struct {
Success bool `json:"success"`
ChallengeTs time.Time `json:"challenge_ts"`
Hostname string `json:"hostname"`
ErrorCodes []string `json:"error-codes"`
Code int `json:"code"`
}
CaptchaResponse res
type CmsService ¶
type CmsService struct {
Store ds.JSONDatastore
TemplateStore ds.JSONDatastore
ContentStorePath string
TemplateStorePath string
TemplateFilePath string
TemplateFullPath string
MailSender ml.Sender
Log *lg.Logger
ImagePath string
ImageFullPath string
CaptchaHost string
MockCaptcha bool
MockCaptchaSuccess bool
MockCaptchaCode int
HitTotal int
ContentHits map[string]int64
HitLimit int
// contains filtered or unexported fields
}
CmsService service
func (*CmsService) ActivateTemplate ¶
func (c *CmsService) ActivateTemplate(name string) bool
ActivateTemplate ActivateTemplate
func (*CmsService) AddContent ¶
func (c *CmsService) AddContent(content *Content) *Response
AddContent add content
func (*CmsService) AddImage ¶
func (c *CmsService) AddImage(name string, fileData []byte) bool
AddImage AddImage
func (*CmsService) AddTemplate ¶
func (c *CmsService) AddTemplate(tpl *Template) bool
AddTemplate AddTemplate
func (*CmsService) AddTemplateFile ¶
func (c *CmsService) AddTemplateFile(name string, originalFileName string, fileData []byte) bool
AddTemplateFile AddTemplateFile
func (*CmsService) DeleteContent ¶
func (c *CmsService) DeleteContent(name string) *Response
DeleteContent delete content
func (*CmsService) DeleteImage ¶
func (c *CmsService) DeleteImage(name string) bool
DeleteImage DeleteImage
func (*CmsService) DeleteTemplate ¶
func (c *CmsService) DeleteTemplate(name string) bool
DeleteTemplate DeleteTemplate
func (*CmsService) DeleteTemplateFile ¶
func (c *CmsService) DeleteTemplateFile(namedir string) bool
DeleteTemplateFile delete template files
func (*CmsService) DownloadBackups ¶
func (c *CmsService) DownloadBackups() (bool, *[]byte)
DownloadBackups DownloadBackups
func (*CmsService) ExtractFile ¶
func (c *CmsService) ExtractFile(t *TemplateFile) bool
ExtractFile extract
func (*CmsService) GetActiveTemplateName ¶
func (c *CmsService) GetActiveTemplateName() string
GetActiveTemplateName GetActiveTemplateName
func (*CmsService) GetContent ¶
func (c *CmsService) GetContent(name string) (bool, *Content)
GetContent get content
func (*CmsService) GetContentList ¶
func (c *CmsService) GetContentList(published bool) *[]Content
GetContentList get content list by client
func (*CmsService) GetImageList ¶
func (c *CmsService) GetImageList() *[]Image
GetImageList GetImageList
func (*CmsService) GetImagePath ¶
func (c *CmsService) GetImagePath(imageName string) string
GetImagePath GetImagePath
func (*CmsService) GetTemplateList ¶
func (c *CmsService) GetTemplateList() *[]Template
GetTemplateList GetTemplateList
func (*CmsService) SendCaptchaCall ¶
func (c *CmsService) SendCaptchaCall(cap Captcha) *CaptchaResponse
SendCaptchaCall SendCaptchaCall
func (*CmsService) SendMail ¶
func (c *CmsService) SendMail(mailer *ml.Mailer) bool
SendMail SendMail
func (*CmsService) UpdateContent ¶
func (c *CmsService) UpdateContent(content *Content) *Response
UpdateContent add content
func (*CmsService) UploadBackups ¶
func (c *CmsService) UploadBackups(bk *[]byte) bool
UploadBackups UploadBackups
type Content ¶
type Content struct {
Name string `json:"name"`
Title string `json:"title"`
Subject string `json:"subject"`
Author string `json:"author"`
CreateDate time.Time `json:"createDate"`
ModifiedDate time.Time `json:"modifiedDate"`
Hits int64 `json:"hits"`
MetaAuthorName string `json:"metaAuthorName"`
MetaDesc string `json:"metaDesc"`
MetaKeyWords string `json:"metaKeyWords"`
MetaRobotKeyWords string `json:"metaRobotKeyWords"`
Text string `json:"text"`
TextHTML template.HTML
Archived bool `json:"archived"`
Visible bool `json:"visible"`
UseModifiedDate bool
BlogPost bool `json:"blogPost"`
}
Content content
type Response ¶
type Response struct {
Success bool `json:"success"`
Name string `json:"name"`
FailCode int `json:"failCode"`
}
Response res
type Service ¶
type Service interface {
AddContent(content *Content) *Response
UpdateContent(content *Content) *Response
GetContent(name string) (bool, *Content)
GetContentList(published bool) *[]Content
DeleteContent(name string) *Response
AddImage(name string, fileData []byte) bool
GetImagePath(imageName string) string
GetImageList() *[]Image
DeleteImage(name string) bool
SendMail(mailer *ml.Mailer) bool
SendCaptchaCall(cap Captcha) *CaptchaResponse
AddTemplateFile(name string, originalFileName string, fileData []byte) bool
AddTemplate(tpl *Template) bool
ActivateTemplate(name string) bool
GetActiveTemplateName() string
GetTemplateList() *[]Template
DeleteTemplate(name string) bool
ExtractFile(tFile *TemplateFile) bool
DeleteTemplateFile(name string) bool
UploadBackups(bk *[]byte) bool
DownloadBackups() (bool, *[]byte)
SaveHits()
HitCheck()
}
Service Service
type Template ¶
type Template struct {
Name string `json:"name"`
Active bool `json:"active"`
ScreenShot string `json:"screenShot"`
}
Template template
type TemplateFile ¶
TemplateFile TemplateFile