contentsrv

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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

func (c *CmsService) GetNew() Service

GetNew GetNew

func (*CmsService) HitCheck

func (c *CmsService) HitCheck()

HitCheck HitCheck

func (*CmsService) SaveHits

func (c *CmsService) SaveHits()

SaveHits SaveHits

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 PageHead struct {
	Title        string
	MetaAuthor   string
	MetaDesc     string
	MetaKeyWords string
}

PageHead used for page head

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL