posting

package
v0.0.0-...-b16c261 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2021 License: MIT Imports: 4 Imported by: 12

Documentation

Overview

Utilities for Article Posting processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConsumePostedArticle

func ConsumePostedArticle(r *fastnntp.DotReader) (head []byte, body []byte)

Sucks in an Article submitted by POST, IHAVE or TAKETHIS. Warning: This routine is allocation heavy.

func CountLines

func CountLines(body []byte) (c int64)

func SplitNewsgroups

func SplitNewsgroups(ng []byte) [][]byte

Types

type HeadInfo

type HeadInfo struct {
	MessageId  []byte
	Newsgroups []byte
	Subject    []byte
	From       []byte
	Date       []byte
	References []byte

	// Raw header
	RAW []byte
}

func ParseAndProcessHeader

func ParseAndProcessHeader(id []byte, s Stamper, head []byte) (hi *HeadInfo)

func ParseAndProcessHeaderWithBuffer

func ParseAndProcessHeaderWithBuffer(id []byte, s Stamper, head []byte, dest_buffer *bytes.Buffer) (hi *HeadInfo)

type HostName

type HostName string

The Hostname implements a Stamper, based on the server's host name. The Message-IDs it generates are purely based on a timestamp.

func (HostName) GetId

func (h HostName) GetId(id_buf []byte) []byte

func (HostName) PathSeg

func (h HostName) PathSeg(buf []byte) []byte

type Stamper

type Stamper interface {
	GetId(id_buf []byte) []byte
	PathSeg(buf []byte) []byte
}

Jump to

Keyboard shortcuts

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