mod_markdown

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Copyright (c) 2019 The BFE Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2019 The BFE Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ModMarkdown         = "mod_markdown"
	MaxBodyBytes        = 32 * 1024
	MarkdownContentType = "text/markdown"
	ConvertContentType  = "text/html; charset=UTF-8"
)
View Source
const DefaultRulePath = "mod_markdown/markdown_rule.data"

Variables

This section is empty.

Functions

func ProductRuleConfLoad

func ProductRuleConfLoad(fileName string) (productRuleConf, error)

func Render

func Render(src []byte) ([]byte, error)

Types

type ConfModMarkdown

type ConfModMarkdown struct {
	Basic struct {
		// md product rule data path
		ProductRulePath string
	}
	Log struct {
		// open debug log
		OpenDebug bool
	}
}

func ConfLoad

func ConfLoad(filePath string, confRoot string) (*ConfModMarkdown, error)

func (*ConfModMarkdown) Check

func (cfg *ConfModMarkdown) Check(confRoot string) error

type MarkdownRuleTable

type MarkdownRuleTable struct {
	// contains filtered or unexported fields
}

func NewMarkdownRuleTable

func NewMarkdownRuleTable() *MarkdownRuleTable

func (*MarkdownRuleTable) Search

func (t *MarkdownRuleTable) Search(product string) (*markdownRules, bool)

func (*MarkdownRuleTable) Update

func (t *MarkdownRuleTable) Update(conf productRuleConf)

type ModuleMarkdown

type ModuleMarkdown struct {
	// contains filtered or unexported fields
}

func NewModuleMarkdown

func NewModuleMarkdown() *ModuleMarkdown

func (*ModuleMarkdown) Init

func (*ModuleMarkdown) Name

func (m *ModuleMarkdown) Name() string

type ModuleMarkdownState

type ModuleMarkdownState struct {
	ReqTotal           *metrics.Counter
	ReqMarkDownRuleHit *metrics.Counter
	RspRenderSuccess   *metrics.Counter
	RspRenderFailure   *metrics.Counter
	RspRenderIgnore    *metrics.Counter
	// detail err reason
	ErrCountReadFail   *metrics.Counter
	ErrCountRenderFail *metrics.Counter
}

Jump to

Keyboard shortcuts

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