atom

package
v0.0.0-...-33854e1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0, BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package atom provides integer codes (also known as atoms) for a fixed set of frequently occurring HTML strings: tag names and attribute keys such as "p" and "id".

Sharing an atom's name between all elements with the same tag can result in fewer string allocations when tokenizing and parsing HTML. Integer comparisons are also generally faster than string comparisons.

The value of an atom's particular code is not guaranteed to stay the same between versions of this package. Neither is any ordering guaranteed: whether atom.H1 < atom.H2 may also change. The codes are not guaranteed to be dense. The only guarantees are that e.g. looking up "div" will yield atom.Div, calling atom.Div.String will return "div", and atom.Div != 0.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(s []byte) string

String returns a string whose contents are equal to s. In that sense, it is equivalent to string(s) but may be more efficient.

Types

type Atom

type Atom uint32

Atom is an integer code for a string. The zero value maps to "".

const (
	A                         Atom = 0x1
	Abbr                      Atom = 0x4
	Accept                    Atom = 0x1a06
	AcceptCharset             Atom = 0x1a0e
	Accesskey                 Atom = 0x2c09
	Acronym                   Atom = 0x6907
	Action                    Atom = 0x26a06
	Address                   Atom = 0x6f307
	Align                     Atom = 0x7005
	Allowfullscreen           Atom = 0x2000f
	Allowpaymentrequest       Atom = 0x8013
	Allowusermedia            Atom = 0x9c0e
	Alt                       Atom = 0xc703
	Annotation                Atom = 0x1c90a
	AnnotationXml             Atom = 0x1c90e
	Applet                    Atom = 0x31106
	Area                      Atom = 0x34e04
	Article                   Atom = 0x3f407
	As                        Atom = 0xd002
	Aside                     Atom = 0xd805
	Async                     Atom = 0xd005
	Audio                     Atom = 0xe605
	Autocomplete              Atom = 0x2700c
	Autofocus                 Atom = 0x10209
	Autoplay                  Atom = 0x11d08
	B                         Atom = 0x101
	Base                      Atom = 0x12c04
	Basefont                  Atom = 0x12c08
	Bdi                       Atom = 0x7903
	Bdo                       Atom = 0x14b03
	Bgsound                   Atom = 0x15e07
	Big                       Atom = 0x17003
	Blink                     Atom = 0x17305
	Blockquote                Atom = 0x1870a
	Body                      Atom = 0x2804
	Br                        Atom = 0x202
	Button                    Atom = 0x19106
	Canvas                    Atom = 0xd406
	Caption                   Atom = 0x22907
	Center                    Atom = 0x21806
	Challenge                 Atom = 0x29309
	Charset                   Atom = 0x2107
	Checked                   Atom = 0x47107
	Cite                      Atom = 0x55c04
	Class                     Atom = 0x5bd05
	Code                      Atom = 0x1a004
	Col                       Atom = 0x1a703
	Colgroup                  Atom = 0x1a708
	Color                     Atom = 0x1bf05
	Cols                      Atom = 0x1c404
	Colspan                   Atom = 0x1c407
	Command                   Atom = 0x1d707
	Content                   Atom = 0x58307
	Contenteditable           Atom = 0x5830f
	Contextmenu               Atom = 0x3780b
	Controls                  Atom = 0x1de08
	Coords                    Atom = 0x1ea06
	Crossorigin               Atom = 0x1f30b
	Data                      Atom = 0x49d04
	Datalist                  Atom = 0x49d08
	Datetime                  Atom = 0x2b008
	Dd                        Atom = 0x2cf02
	Default                   Atom = 0xdb07
	Defer                     Atom = 0x1a205
	Del                       Atom = 0x44a03
	Desc                      Atom = 0x55904
	Details                   Atom = 0x4607
	Dfn                       Atom = 0x5f03
	Dialog                    Atom = 0x7a06
	Dir                       Atom = 0xba03
	Dirname                   Atom = 0xba07
	Disabled                  Atom = 0x16408
	Div                       Atom = 0x16b03
	Dl                        Atom = 0x5e602
	Download                  Atom = 0x45b08
	Draggable                 Atom = 0x17a09
	Dropzone                  Atom = 0x3fd08
	Dt                        Atom = 0x64b02
	Em                        Atom = 0x4202
	Embed                     Atom = 0x4205
	Enctype                   Atom = 0x28507
	Face                      Atom = 0x21604
	Fieldset                  Atom = 0x21e08
	Figcaption                Atom = 0x2260a
	Figure                    Atom = 0x24006
	Font                      Atom = 0x13004
	Footer                    Atom = 0xca06
	For                       Atom = 0x24c03
	ForeignObject             Atom = 0x24c0d
	Foreignobject             Atom = 0x2590d
	Form                      Atom = 0x26604
	Formaction                Atom = 0x2660a
	Formenctype               Atom = 0x2810b
	Formmethod                Atom = 0x29c0a
	Formnovalidate            Atom = 0x2a60e
	Formtarget                Atom = 0x2b80a
	Frame                     Atom = 0x5705
	Frameset                  Atom = 0x5708
	H1                        Atom = 0x15c02
	H2                        Atom = 0x2d602
	H3                        Atom = 0x30502
	H4                        Atom = 0x33d02
	H5                        Atom = 0x34702
	H6                        Atom = 0x64d02
	Head                      Atom = 0x32904
	Header                    Atom = 0x32906
	Headers                   Atom = 0x32907
	Height                    Atom = 0x14306
	Hgroup                    Atom = 0x2c206
	Hidden                    Atom = 0x2cd06
	High                      Atom = 0x2d304
	Hr                        Atom = 0x15702
	Href                      Atom = 0x2d804
	Hreflang                  Atom = 0x2d808
	Html                      Atom = 0x14704
	HttpEquiv                 Atom = 0x2e00a
	I                         Atom = 0x601
	Icon                      Atom = 0x58204
	Id                        Atom = 0xda02
	Iframe                    Atom = 0x2f406
	Image                     Atom = 0x2fa05
	Img                       Atom = 0x2ff03
	Input                     Atom = 0x44305
	Inputmode                 Atom = 0x44309
	Ins                       Atom = 0x1fc03
	Integrity                 Atom = 0x23709
	Is                        Atom = 0x16502
	Isindex                   Atom = 0x30707
	Ismap                     Atom = 0x30e05
	Itemid                    Atom = 0x38306
	Itemprop                  Atom = 0x55d08
	Itemref                   Atom = 0x3c507
	Itemscope                 Atom = 0x67109
	Itemtype                  Atom = 0x31708
	Kbd                       Atom = 0x7803
	Keygen                    Atom = 0x3206
	Keytype                   Atom = 0x9507
	Kind                      Atom = 0x17704
	Label                     Atom = 0xf105
	Lang                      Atom = 0x2dc04
	Legend                    Atom = 0x18106
	Li                        Atom = 0x7102
	Link                      Atom = 0x17404
	List                      Atom = 0x4a104
	Listing                   Atom = 0x4a107
	Loop                      Atom = 0xf504
	Low                       Atom = 0x8203
	Main                      Atom = 0x1004
	Malignmark                Atom = 0x6f0a
	Manifest                  Atom = 0x6d708
	Map                       Atom = 0x31003
	Mark                      Atom = 0x7504
	Marquee                   Atom = 0x31f07
	Math                      Atom = 0x32604
	Max                       Atom = 0x33503
	Maxlength                 Atom = 0x33509
	Media                     Atom = 0xa505
	Mediagroup                Atom = 0xa50a
	Menu                      Atom = 0x37f04
	Menuitem                  Atom = 0x37f08
	Meta                      Atom = 0x4b004
	Meter                     Atom = 0xbf05
	Method                    Atom = 0x2a006
	Mglyph                    Atom = 0x30006
	Mi                        Atom = 0x33f02
	Min                       Atom = 0x33f03
	Minlength                 Atom = 0x33f09
	Mn                        Atom = 0x2a902
	Mo                        Atom = 0x6302
	Ms                        Atom = 0x67402
	Mtext                     Atom = 0x34905
	Multiple                  Atom = 0x35708
	Muted                     Atom = 0x35f05
	Name                      Atom = 0xbd04
	Nav                       Atom = 0x1303
	Nobr                      Atom = 0x3704
	Noembed                   Atom = 0x4007
	Noframes                  Atom = 0x5508
	Nomodule                  Atom = 0x6108
	Nonce                     Atom = 0x56605
	Noscript                  Atom = 0x20e08
	Novalidate                Atom = 0x2aa0a
	Object                    Atom = 0x26006
	Ol                        Atom = 0x11802
	Onabort                   Atom = 0x19507
	Onafterprint              Atom = 0x22e0c
	Onautocomplete            Atom = 0x26e0e
	Onautocompleteerror       Atom = 0x26e13
	Onauxclick                Atom = 0x61f0a
	Onbeforeprint             Atom = 0x69e0d
	Onbeforeunload            Atom = 0x6e70e
	Onblur                    Atom = 0x5c606
	Oncancel                  Atom = 0xea08
	Oncanplay                 Atom = 0x14d09
	Oncanplaythrough          Atom = 0x14d10
	Onchange                  Atom = 0x41308
	Onclick                   Atom = 0x2ed07
	Onclose                   Atom = 0x36407
	Oncontextmenu             Atom = 0x3760d
	Oncopy                    Atom = 0x38906
	Oncuechange               Atom = 0x38f0b
	Oncut                     Atom = 0x39a05
	Ondblclick                Atom = 0x39f0a
	Ondrag                    Atom = 0x3a906
	Ondragend                 Atom = 0x3a909
	Ondragenter               Atom = 0x3b20b
	Ondragexit                Atom = 0x3bd0a
	Ondragleave               Atom = 0x3d70b
	Ondragover                Atom = 0x3e20a
	Ondragstart               Atom = 0x3ec0b
	Ondrop                    Atom = 0x3fb06
	Ondurationchange          Atom = 0x40b10
	Onemptied                 Atom = 0x40209
	Onended                   Atom = 0x41b07
	Onerror                   Atom = 0x42207
	Onfocus                   Atom = 0x42907
	Onhashchange              Atom = 0x4350c
	Oninput                   Atom = 0x44107
	Oninvalid                 Atom = 0x44d09
	Onkeydown                 Atom = 0x45609
	Onkeypress                Atom = 0x4630a
	Onkeyup                   Atom = 0x47807
	Onlanguagechange          Atom = 0x48510
	Onload                    Atom = 0x49506
	Onloadeddata              Atom = 0x4950c
	Onloadedmetadata          Atom = 0x4a810
	Onloadend                 Atom = 0x4be09
	Onloadstart               Atom = 0x4c70b
	Onmessage                 Atom = 0x4d209
	Onmessageerror            Atom = 0x4d20e
	Onmousedown               Atom = 0x4e00b
	Onmouseenter              Atom = 0x4eb0c
	Onmouseleave              Atom = 0x4f70c
	Onmousemove               Atom = 0x5030b
	Onmouseout                Atom = 0x50e0a
	Onmouseover               Atom = 0x51b0b
	Onmouseup                 Atom = 0x52609
	Onmousewheel              Atom = 0x5340c
	Onoffline                 Atom = 0x54009
	Ononline                  Atom = 0x54908
	Onpagehide                Atom = 0x5510a
	Onpageshow                Atom = 0x56b0a
	Onpaste                   Atom = 0x57707
	Onpause                   Atom = 0x59207
	Onplay                    Atom = 0x59c06
	Onplaying                 Atom = 0x59c09
	Onpopstate                Atom = 0x5a50a
	Onprogress                Atom = 0x5af0a
	Onratechange              Atom = 0x5cc0c
	Onrejectionhandled        Atom = 0x5d812
	Onreset                   Atom = 0x5ea07
	Onresize                  Atom = 0x5f108
	Onscroll                  Atom = 0x60008
	Onsecuritypolicyviolation Atom = 0x60819
	Onseeked                  Atom = 0x62908
	Onseeking                 Atom = 0x63109
	Onselect                  Atom = 0x63a08
	Onshow                    Atom = 0x64406
	Onsort                    Atom = 0x64f06
	Onstalled                 Atom = 0x65909
	Onstorage                 Atom = 0x66209
	Onsubmit                  Atom = 0x66b08
	Onsuspend                 Atom = 0x67b09
	Ontimeupdate              Atom = 0x1310c
	Ontoggle                  Atom = 0x68408
	Onunhandledrejection      Atom = 0x68c14
	Onunload                  Atom = 0x6ab08
	Onvolumechange            Atom = 0x6b30e
	Onwaiting                 Atom = 0x6c109
	Onwheel                   Atom = 0x6ca07
	Open                      Atom = 0x56304
	Optgroup                  Atom = 0xf708
	Optimum                   Atom = 0x6d107
	Option                    Atom = 0x6e306
	Output                    Atom = 0x51506
	P                         Atom = 0xc01
	Param                     Atom = 0xc05
	Pattern                   Atom = 0x4f07
	Picture                   Atom = 0xae07
	Ping                      Atom = 0xfe04
	Placeholder               Atom = 0x1120b
	Plaintext                 Atom = 0x1ae09
	Playsinline               Atom = 0x1210b
	Poster                    Atom = 0x2c706
	Pre                       Atom = 0x46803
	Preload                   Atom = 0x47e07
	Progress                  Atom = 0x5b108
	Prompt                    Atom = 0x52e06
	Public                    Atom = 0x57e06
	Q                         Atom = 0x8e01
	Radiogroup                Atom = 0x30a
	Readonly                  Atom = 0x34f08
	Referrerpolicy            Atom = 0x3c90e
	Rel                       Atom = 0x47f03
	Required                  Atom = 0x24408
	Reversed                  Atom = 0xb308
	Rows                      Atom = 0x3a04
	Rowspan                   Atom = 0x3a07
	Rp                        Atom = 0x23402
	Rt                        Atom = 0x19a02
	Ruby                      Atom = 0xc304
	S                         Atom = 0x2501
	Samp                      Atom = 0x4c04
	Sandbox                   Atom = 0x10a07
	Scope                     Atom = 0x67505
	Scoped                    Atom = 0x67506
	Script                    Atom = 0x21006
	Seamless                  Atom = 0x36908
	Section                   Atom = 0x5c107
	Select                    Atom = 0x63c06
	Selected                  Atom = 0x63c08
	Shape                     Atom = 0x1e505
	Size                      Atom = 0x5f504
	Sizes                     Atom = 0x5f505
	Slot                      Atom = 0x1ef04
	Small                     Atom = 0x1fe05
	Sortable                  Atom = 0x65108
	Sorted                    Atom = 0x32f06
	Source                    Atom = 0x37006
	Spacer                    Atom = 0x42f06
	Span                      Atom = 0x3d04
	Spellcheck                Atom = 0x46c0a
	Src                       Atom = 0x5b803
	Srcdoc                    Atom = 0x5b806
	Srclang                   Atom = 0x5f907
	Srcset                    Atom = 0x6f906
	Start                     Atom = 0x3f205
	Step                      Atom = 0x57b04
	Strike                    Atom = 0x9106
	Strong                    Atom = 0x6dd06
	Style                     Atom = 0x6ff05
	Sub                       Atom = 0x66d03
	Summary                   Atom = 0x70407
	Sup                       Atom = 0x70b03
	Svg                       Atom = 0x70e03
	System                    Atom = 0x71106
	Tabindex                  Atom = 0x4b608
	Table                     Atom = 0x58d05
	Target                    Atom = 0x2bc06
	Tbody                     Atom = 0x2705
	Td                        Atom = 0x5e02
	Template                  Atom = 0x71408
	Textarea                  Atom = 0x34a08
	Tfoot                     Atom = 0xc905
	Th                        Atom = 0x15602
	Thead                     Atom = 0x32805
	Time                      Atom = 0x13304
	Title                     Atom = 0xe105
	Tr                        Atom = 0x8b02
	Track                     Atom = 0x19b05
	Translate                 Atom = 0x1b609
	Tt                        Atom = 0x5102
	Type                      Atom = 0x9804
	Typemustmatch             Atom = 0x2880d
	U                         Atom = 0xb01
	Ul                        Atom = 0x6602
	Updateviacache            Atom = 0x1370e
	Usemap                    Atom = 0x59606
	Value                     Atom = 0x1505
	Var                       Atom = 0x16d03
	Video                     Atom = 0x2e905
	Wbr                       Atom = 0x57403
	Width                     Atom = 0x64905
	Workertype                Atom = 0x71c0a
	Wrap                      Atom = 0x72604
	Xmp                       Atom = 0x11003
)

func Lookup

func Lookup(s []byte) Atom

Lookup returns the atom whose name is s. It returns zero if there is no such atom. The lookup is case sensitive.

func (Atom) String

func (a Atom) String() string

String returns the atom's name.

Jump to

Keyboard shortcuts

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