parser

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: AGPL-3.0, AGPL-3.0-or-later Imports: 11 Imported by: 0

Documentation

Overview

Package parser parses and verifies user-sent post data

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommandRegexp matches any hash command in a line
	CommandRegexp = regexp.MustCompile(`^#(flip|\d*d\d+|8ball|pyu|pcount)$`)
)

Functions

func ParseBody

func ParseBody(body, board string) (
	links common.LinkMap, com []common.Command, err error,
)

ParseBody parses the entire post text body for commands and links

func ParseLine

func ParseLine(line, board string) (common.LinkMap, common.Command, error)

ParseLine parses a full text line of a post

func ParseName

func ParseName(name string) (string, string, error)

ParseName parses the name field into a name and tripcode, if any

func ParseSubject

func ParseSubject(s string) (string, error)

ParseSubject verifies and trims a thread subject string

func VerifyPostPassword

func VerifyPostPassword(s string) error

VerifyPostPassword verifies a post password exists does not surpass the maximum allowed length

Types

This section is empty.

Jump to

Keyboard shortcuts

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