ixml

package
v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DAV_NS     = "DAV:"
	CALDAV_NS  = "urn:ietf:params:xml:ns:caldav"
	CALSERV_NS = "http://calendarserver.org/ns/"
)

Variables

View Source
var (
	CALENDAR_TG                         = xml.Name{CALDAV_NS, "calendar"}
	CALENDAR_DATA_TG                    = xml.Name{CALDAV_NS, "calendar-data"}
	CALENDAR_HOME_SET_TG                = xml.Name{CALDAV_NS, "calendar-home-set"}
	CALENDAR_QUERY_TG                   = xml.Name{CALDAV_NS, "calendar-query"}
	CALENDAR_MULTIGET_TG                = xml.Name{CALDAV_NS, "calendar-multiget"}
	CALENDAR_USER_ADDRESS_SET_TG        = xml.Name{CALDAV_NS, "calendar-user-address-set"}
	COLLECTION_TG                       = xml.Name{DAV_NS, "collection"}
	CURRENT_USER_PRINCIPAL_TG           = xml.Name{DAV_NS, "current-user-principal"}
	DISPLAY_NAME_TG                     = xml.Name{DAV_NS, "displayname"}
	GET_CONTENT_LENGTH_TG               = xml.Name{DAV_NS, "getcontentlength"}
	GET_CONTENT_TYPE_TG                 = xml.Name{DAV_NS, "getcontenttype"}
	GET_CTAG_TG                         = xml.Name{CALSERV_NS, "getctag"}
	GET_ETAG_TG                         = xml.Name{DAV_NS, "getetag"}
	GET_LAST_MODIFIED_TG                = xml.Name{DAV_NS, "getlastmodified"}
	HREF_TG                             = xml.Name{DAV_NS, "href"}
	OWNER_TG                            = xml.Name{DAV_NS, "owner"}
	PRINCIPAL_TG                        = xml.Name{DAV_NS, "principal"}
	PRINCIPAL_COLLECTION_SET_TG         = xml.Name{DAV_NS, "principal-collection-set"}
	PRINCIPAL_URL_TG                    = xml.Name{DAV_NS, "principal-URL"}
	RESOURCE_TYPE_TG                    = xml.Name{DAV_NS, "resourcetype"}
	STATUS_TG                           = xml.Name{DAV_NS, "status"}
	SUPPORTED_CALENDAR_COMPONENT_SET_TG = xml.Name{CALDAV_NS, "supported-calendar-component-set"}
)
View Source
var NS_PREFIXES = map[string]string{
	DAV_NS:     "D",
	CALDAV_NS:  "C",
	CALSERV_NS: "CS",
}

Functions

func EscapeText

func EscapeText(text string) string

EscapeText escapes any special character in the given text and returns the result.

func HrefTag

func HrefTag(href string) (tag string)

HrefTag returns a DAV <D:href> tag with the given href path.

func Namespaces

func Namespaces() string

func StatusTag

func StatusTag(status int) string

StatusTag returns a DAV <D:status> tag with the given HTTP status. The status is translated into a label, e.g.: HTTP/1.1 404 NotFound.

func Tag

func Tag(xmlName xml.Name, content string) string

Tag returns a XML tag as string based on the given tag name and content. It takes in consideration the namespace and also if it is an empty content or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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