tagvalue

package module
v0.0.0-...-45d3164 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2021 License: BSD-2-Clause Imports: 7 Imported by: 0

README

tagvalue

Parse RFC 6376 tag=value strings, as used in DKIM and DMARC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMap

func NewMap(input string) (map[string]Field, error)

NewMap parses a rfc 6376 tag=value input and returns a map of tag to item

Types

type DkimKey

type DkimKey struct {
	V            Field
	G            Field
	H            Field
	K            Field
	N            Field
	P            Field
	S            Field
	T            Field
	Unrecognized map[string]Field
	ParseError   ParseError
}

DkimKey represents a DKIM public key, as published to DNS in a format intended for diagnostics and display

func NewDkimKey

func NewDkimKey(input string) DkimKey

type Field

type Field struct {
	Item
	Index     int
	Duplicate bool
	Defined   bool
	Errors    []FieldError
}

type FieldError

type FieldError struct {
	Message  template.HTML
	Severity string
}

type Item

type Item struct {
	Tag      string
	Value    string
	TagPos   int
	ValuePos int
}

func NewTagValue

func NewTagValue(input string) ([]Item, error)

NewTagValue parses a rfc 6376 tag=value input and returns a slice containing all the parsed tag-value pairs

type ParseError

type ParseError struct {
	Message string
	Pos     int
}

func (ParseError) Error

func (e ParseError) Error() string

Jump to

Keyboard shortcuts

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