cap

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	XMLName struct{} `xml:"urn:oasis:names:tc:emergency:cap:1.2 alert"`

	// Version is the detected CAP version ("1.1" or "1.2"), set by the parser.
	Version string `xml:"-"`
	// contains filtered or unexported fields
}

Alert represents a CAP alert message (supports both 1.1 and 1.2). The Version field is set by the parser to indicate which CAP version was detected.

type Area

type Area struct {
	AreaDesc string       `xml:"areaDesc"`
	Polygon  []string     `xml:"polygon,omitempty"`
	Circle   []string     `xml:"circle,omitempty"`
	Geocode  []*ValuePair `xml:"geocode,omitempty"`
	Altitude string       `xml:"altitude,omitempty"`
	Ceiling  string       `xml:"ceiling,omitempty"`
}

Area represents a geographic area

type Info

type Info struct {
	Language     string       `xml:"language,omitempty"`
	Category     []string     `xml:"category"`
	Event        string       `xml:"event"`
	ResponseType []string     `xml:"responseType,omitempty"`
	Urgency      string       `xml:"urgency"`
	Severity     string       `xml:"severity"`
	Certainty    string       `xml:"certainty"`
	Audience     string       `xml:"audience,omitempty"`
	EventCode    []*ValuePair `xml:"eventCode,omitempty"`
	Effective    string       `xml:"effective,omitempty"`
	Onset        string       `xml:"onset,omitempty"`
	Expires      string       `xml:"expires,omitempty"`
	SenderName   string       `xml:"senderName,omitempty"`
	Headline     string       `xml:"headline,omitempty"`
	Description  string       `xml:"description,omitempty"`
	Instruction  string       `xml:"instruction,omitempty"`
	Web          string       `xml:"web,omitempty"`
	Contact      string       `xml:"contact,omitempty"`
	Parameter    []*ValuePair `xml:"parameter,omitempty"`
	Resource     []*Resource  `xml:"resource,omitempty"`
	Area         []*Area      `xml:"area,omitempty"`
}

Info represents the info element in a CAP alert

type Parser

type Parser struct{}

Parser is a CAP Parser

func (*Parser) Parse

func (cp *Parser) Parse(feed io.Reader) (interface{}, error)

Parse parses a CAP XML feed into a cap.Alert. It supports both CAP 1.2 and CAP 1.1 namespaces.

type Resource

type Resource struct {
	ResourceDesc string `xml:"resourceDesc"`
	MimeType     string `xml:"mimeType,omitempty"`
	Size         int    `xml:"size,omitempty"`
	URI          string `xml:"uri,omitempty"`
	DerefURI     string `xml:"derefUri,omitempty"`
	Digest       string `xml:"digest,omitempty"`
}

Resource represents a resource element

type ValuePair

type ValuePair struct {
	ValueName string `xml:"valueName"`
	Value     string `xml:"value"`
}

ValuePair represents a name-value pair

Jump to

Keyboard shortcuts

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