Documentation ¶
Index ¶
- type Captcha
- type CaptchaResponse
- type CmsService
- func (c *CmsService) AddContent(content *Content) *Response
- func (c *CmsService) DeleteContent(name string) *Response
- func (c *CmsService) GetContent(name string) (bool, *Content)
- func (c *CmsService) GetContentList(published bool) *[]Content
- func (c *CmsService) GetNew() Service
- func (c *CmsService) HitCheck()
- func (c *CmsService) SaveHits()
- func (c *CmsService) SendCaptchaCall(cap Captcha) *CaptchaResponse
- func (c *CmsService) UpdateContent(content *Content) *Response
- type Content
- type PageHead
- type Response
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ContentStorePath string Log *lg.Logger 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) AddContent ¶
func (c *CmsService) AddContent(content *Content) *Response
AddContent add content
func (*CmsService) DeleteContent ¶
func (c *CmsService) DeleteContent(name string) *Response
DeleteContent delete content
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) SendCaptchaCall ¶
func (c *CmsService) SendCaptchaCall(cap Captcha) *CaptchaResponse
SendCaptchaCall SendCaptchaCall
func (*CmsService) UpdateContent ¶
func (c *CmsService) UpdateContent(content *Content) *Response
UpdateContent add content
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 SendCaptchaCall(cap Captcha) *CaptchaResponse SaveHits() HitCheck() }
Service Service
Click to show internal directories.
Click to hide internal directories.