protocol

package
v0.0.0-...-54413c5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CRLF            = "\r\n"
	MultilineEnding = "."
)
View Source
const (
	CommandCapabilities = "CAPABILITIES"
	CommandQuit         = "QUIT"
	CommandDate         = "DATE"
	CommandMode         = "MODE"
	CommandList         = "LIST"
	CommandGroup        = "GROUP"
	CommandNewGroups    = "NEWGROUPS"
	CommandPost         = "POST"
	CommandListGroup    = "LISTGROUP"
	CommandArticle      = "ARTICLE"
	CommandHead         = "HEAD"
	CommandBody         = "BODY"
	CommandStat         = "STAT"
	CommandHelp         = "HELP"
	CommandNewNews      = "NEWNEWS"
	CommandLast         = "LAST"
	CommandNext         = "NEXT"
	CommandOver         = "OVER"
	CommandXover        = "XOVER"
	CommandIHave        = "IHAVE"
)
View Source
const (
	CapabilityNameVersion        = "VERSION"
	CapabilityNameReader         = "READER"
	CapabilityNameIHave          = "IHAVE"
	CapabilityNamePost           = "POST"
	CapabilityNameNewNews        = "NEWNEWS"
	CapabilityNameHdr            = "HDR"
	CapabilityNameOver           = "OVER"
	CapabilityNameList           = "LIST"
	CapabilityNameImplementation = "IMPLEMENTATION"
	CapabilityNameModeReader     = "MODE-READER"
)

Variables

View Source
var (
	ErrSyntaxError = NNTPResponse{Code: 501, Message: "Syntax Error"}
)

Functions

func IsMessageHeaderAllowed

func IsMessageHeaderAllowed(headerName string) bool

Types

type Capabilities

type Capabilities []Capability

func (*Capabilities) Add

func (cs *Capabilities) Add(c Capability)

func (*Capabilities) Remove

func (cs *Capabilities) Remove(ct CapabilityType)

func (Capabilities) String

func (cs Capabilities) String() string

type Capability

type Capability struct {
	Type   CapabilityType
	Params string // optional
}

type CapabilityType

type CapabilityType int
const (
	VersionCapability CapabilityType = iota
	ReaderCapability
	IHaveCapability
	PostCapability
	NewNewsCapability
	HdrCapability
	OverCapability
	ListCapability
	ImplementationCapability
	ModeReaderCapability
)

func (CapabilityType) String

func (ct CapabilityType) String() string

type NNTPResponse

type NNTPResponse struct {
	Code    int
	Message string
}

func (NNTPResponse) String

func (nr NNTPResponse) String() string

Jump to

Keyboard shortcuts

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