atom

package
v0.0.0-...-2824937 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT, 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
	Action                    Atom = 0x25a06
	Address                   Atom = 0x6ed07
	Align                     Atom = 0x6d405
	Allowfullscreen           Atom = 0x1f00f
	Allowpaymentrequest       Atom = 0x6913
	Allowusermedia            Atom = 0x850e
	Alt                       Atom = 0xb003
	Annotation                Atom = 0x1b90a
	AnnotationXml             Atom = 0x1b90e
	Applet                    Atom = 0x30106
	Area                      Atom = 0x34a04
	Article                   Atom = 0x3f007
	As                        Atom = 0xb902
	Aside                     Atom = 0xc105
	Async                     Atom = 0xb905
	Audio                     Atom = 0xcf05
	Autocomplete              Atom = 0x2600c
	Autofocus                 Atom = 0xeb09
	Autoplay                  Atom = 0x10608
	B                         Atom = 0x101
	Base                      Atom = 0x11504
	Basefont                  Atom = 0x11508
	Bdi                       Atom = 0x16103
	Bdo                       Atom = 0x13403
	Bgsound                   Atom = 0x14707
	Big                       Atom = 0x15903
	Blink                     Atom = 0x15c05
	Blockquote                Atom = 0x1680a
	Body                      Atom = 0x2804
	Br                        Atom = 0x202
	Button                    Atom = 0x17206
	Canvas                    Atom = 0xbd06
	Caption                   Atom = 0x21907
	Center                    Atom = 0x20806
	Challenge                 Atom = 0x28309
	Charset                   Atom = 0x2107
	Checked                   Atom = 0x46d07
	Cite                      Atom = 0x55804
	Class                     Atom = 0x5b905
	Code                      Atom = 0x19004
	Col                       Atom = 0x19703
	Colgroup                  Atom = 0x19708
	Color                     Atom = 0x1af05
	Cols                      Atom = 0x1b404
	Colspan                   Atom = 0x1b407
	Command                   Atom = 0x1c707
	Content                   Atom = 0x57f07
	Contenteditable           Atom = 0x57f0f
	Contextmenu               Atom = 0x3740b
	Controls                  Atom = 0x1ce08
	Coords                    Atom = 0x1da06
	Crossorigin               Atom = 0x1e30b
	Data                      Atom = 0x49904
	Datalist                  Atom = 0x49908
	Datetime                  Atom = 0x2a008
	Dd                        Atom = 0x2bf02
	Default                   Atom = 0xc407
	Defer                     Atom = 0x19205
	Del                       Atom = 0x44603
	Desc                      Atom = 0x55504
	Details                   Atom = 0x4607
	Dfn                       Atom = 0x5f03
	Dialog                    Atom = 0x16206
	Dir                       Atom = 0xa303
	Dirname                   Atom = 0xa307
	Disabled                  Atom = 0x14d08
	Div                       Atom = 0x15403
	Dl                        Atom = 0x5e202
	Download                  Atom = 0x45708
	Draggable                 Atom = 0x18309
	Dropzone                  Atom = 0x3f908
	Dt                        Atom = 0x64702
	Em                        Atom = 0x4202
	Embed                     Atom = 0x4205
	Enctype                   Atom = 0x27507
	Face                      Atom = 0x20604
	Fieldset                  Atom = 0x20e08
	Figcaption                Atom = 0x2160a
	Figure                    Atom = 0x23006
	Font                      Atom = 0x11904
	Footer                    Atom = 0xb306
	For                       Atom = 0x23c03
	ForeignObject             Atom = 0x23c0d
	Foreignobject             Atom = 0x2490d
	Form                      Atom = 0x25604
	Formaction                Atom = 0x2560a
	Formenctype               Atom = 0x2710b
	Formmethod                Atom = 0x28c0a
	Formnovalidate            Atom = 0x2960e
	Formtarget                Atom = 0x2a80a
	Frame                     Atom = 0x5705
	Frameset                  Atom = 0x5708
	H1                        Atom = 0x14502
	H2                        Atom = 0x2c602
	H3                        Atom = 0x2f502
	H4                        Atom = 0x33902
	H5                        Atom = 0x34302
	H6                        Atom = 0x64902
	Head                      Atom = 0x32504
	Header                    Atom = 0x32506
	Headers                   Atom = 0x32507
	Height                    Atom = 0x12c06
	Hgroup                    Atom = 0x2b206
	Hidden                    Atom = 0x2bd06
	High                      Atom = 0x2c304
	Hr                        Atom = 0x14002
	Href                      Atom = 0x2c804
	Hreflang                  Atom = 0x2c808
	Html                      Atom = 0x13004
	HttpEquiv                 Atom = 0x2d00a
	I                         Atom = 0x601
	Icon                      Atom = 0x57e04
	Id                        Atom = 0xc302
	Iframe                    Atom = 0x2e406
	Image                     Atom = 0x2ea05
	Img                       Atom = 0x2ef03
	Input                     Atom = 0x43f05
	Inputmode                 Atom = 0x43f09
	Ins                       Atom = 0x1ec03
	Integrity                 Atom = 0x22709
	Is                        Atom = 0x14e02
	Isindex                   Atom = 0x2f707
	Ismap                     Atom = 0x2fe05
	Itemid                    Atom = 0x37f06
	Itemprop                  Atom = 0x55908
	Itemref                   Atom = 0x3c107
	Itemscope                 Atom = 0x66d09
	Itemtype                  Atom = 0x30708
	Kbd                       Atom = 0x16003
	Keygen                    Atom = 0x3206
	Keytype                   Atom = 0x7e07
	Kind                      Atom = 0x18004
	Label                     Atom = 0xda05
	Lang                      Atom = 0x2cc04
	Legend                    Atom = 0x18a06
	Li                        Atom = 0x11102
	Link                      Atom = 0x15d04
	List                      Atom = 0x49d04
	Listing                   Atom = 0x49d07
	Loop                      Atom = 0xde04
	Low                       Atom = 0x6b03
	Main                      Atom = 0x1004
	Malignmark                Atom = 0x6d30a
	Manifest                  Atom = 0x30f08
	Map                       Atom = 0x30003
	Mark                      Atom = 0x6d904
	Marquee                   Atom = 0x31b07
	Math                      Atom = 0x32204
	Max                       Atom = 0x33103
	Maxlength                 Atom = 0x33109
	Media                     Atom = 0x8e05
	Mediagroup                Atom = 0x8e0a
	Menu                      Atom = 0x37b04
	Menuitem                  Atom = 0x37b08
	Meta                      Atom = 0x4ac04
	Meter                     Atom = 0xa805
	Method                    Atom = 0x29006
	Mglyph                    Atom = 0x2f006
	Mi                        Atom = 0x33b02
	Min                       Atom = 0x33b03
	Minlength                 Atom = 0x33b09
	Mn                        Atom = 0x29902
	Mo                        Atom = 0x6302
	Ms                        Atom = 0x67002
	Mtext                     Atom = 0x34505
	Multiple                  Atom = 0x35308
	Muted                     Atom = 0x35b05
	Name                      Atom = 0xa604
	Nav                       Atom = 0x1303
	Nobr                      Atom = 0x3704
	Noembed                   Atom = 0x4007
	Noframes                  Atom = 0x5508
	Nomodule                  Atom = 0x6108
	Nonce                     Atom = 0x56205
	Noscript                  Atom = 0x1fe08
	Novalidate                Atom = 0x29a0a
	Object                    Atom = 0x25006
	Ol                        Atom = 0x10102
	Onabort                   Atom = 0x17607
	Onafterprint              Atom = 0x21e0c
	Onautocomplete            Atom = 0x25e0e
	Onautocompleteerror       Atom = 0x25e13
	Onauxclick                Atom = 0x61b0a
	Onbeforeprint             Atom = 0x69a0d
	Onbeforeunload            Atom = 0x6e10e
	Onblur                    Atom = 0x5c206
	Oncancel                  Atom = 0xd308
	Oncanplay                 Atom = 0x13609
	Oncanplaythrough          Atom = 0x13610
	Onchange                  Atom = 0x40f08
	Onclick                   Atom = 0x2dd07
	Onclose                   Atom = 0x36007
	Oncontextmenu             Atom = 0x3720d
	Oncopy                    Atom = 0x38506
	Oncuechange               Atom = 0x38b0b
	Oncut                     Atom = 0x39605
	Ondblclick                Atom = 0x39b0a
	Ondrag                    Atom = 0x3a506
	Ondragend                 Atom = 0x3a509
	Ondragenter               Atom = 0x3ae0b
	Ondragexit                Atom = 0x3b90a
	Ondragleave               Atom = 0x3d30b
	Ondragover                Atom = 0x3de0a
	Ondragstart               Atom = 0x3e80b
	Ondrop                    Atom = 0x3f706
	Ondurationchange          Atom = 0x40710
	Onemptied                 Atom = 0x3fe09
	Onended                   Atom = 0x41707
	Onerror                   Atom = 0x41e07
	Onfocus                   Atom = 0x42507
	Onhashchange              Atom = 0x4310c
	Oninput                   Atom = 0x43d07
	Oninvalid                 Atom = 0x44909
	Onkeydown                 Atom = 0x45209
	Onkeypress                Atom = 0x45f0a
	Onkeyup                   Atom = 0x47407
	Onlanguagechange          Atom = 0x48110
	Onload                    Atom = 0x49106
	Onloadeddata              Atom = 0x4910c
	Onloadedmetadata          Atom = 0x4a410
	Onloadend                 Atom = 0x4ba09
	Onloadstart               Atom = 0x4c30b
	Onmessage                 Atom = 0x4ce09
	Onmessageerror            Atom = 0x4ce0e
	Onmousedown               Atom = 0x4dc0b
	Onmouseenter              Atom = 0x4e70c
	Onmouseleave              Atom = 0x4f30c
	Onmousemove               Atom = 0x4ff0b
	Onmouseout                Atom = 0x50a0a
	Onmouseover               Atom = 0x5170b
	Onmouseup                 Atom = 0x52209
	Onmousewheel              Atom = 0x5300c
	Onoffline                 Atom = 0x53c09
	Ononline                  Atom = 0x54508
	Onpagehide                Atom = 0x54d0a
	Onpageshow                Atom = 0x5670a
	Onpaste                   Atom = 0x57307
	Onpause                   Atom = 0x58e07
	Onplay                    Atom = 0x59806
	Onplaying                 Atom = 0x59809
	Onpopstate                Atom = 0x5a10a
	Onprogress                Atom = 0x5ab0a
	Onratechange              Atom = 0x5c80c
	Onrejectionhandled        Atom = 0x5d412
	Onreset                   Atom = 0x5e607
	Onresize                  Atom = 0x5ed08
	Onscroll                  Atom = 0x5fc08
	Onsecuritypolicyviolation Atom = 0x60419
	Onseeked                  Atom = 0x62508
	Onseeking                 Atom = 0x62d09
	Onselect                  Atom = 0x63608
	Onshow                    Atom = 0x64006
	Onsort                    Atom = 0x64b06
	Onstalled                 Atom = 0x65509
	Onstorage                 Atom = 0x65e09
	Onsubmit                  Atom = 0x66708
	Onsuspend                 Atom = 0x67709
	Ontimeupdate              Atom = 0x11a0c
	Ontoggle                  Atom = 0x68008
	Onunhandledrejection      Atom = 0x68814
	Onunload                  Atom = 0x6a708
	Onvolumechange            Atom = 0x6af0e
	Onwaiting                 Atom = 0x6bd09
	Onwheel                   Atom = 0x6c607
	Open                      Atom = 0x55f04
	Optgroup                  Atom = 0xe008
	Optimum                   Atom = 0x6cd07
	Option                    Atom = 0x6dd06
	Output                    Atom = 0x51106
	P                         Atom = 0xc01
	Param                     Atom = 0xc05
	Pattern                   Atom = 0x4f07
	Picture                   Atom = 0x9707
	Ping                      Atom = 0xe704
	Placeholder               Atom = 0xfb0b
	Plaintext                 Atom = 0x19e09
	Playsinline               Atom = 0x10a0b
	Poster                    Atom = 0x2b706
	Pre                       Atom = 0x46403
	Preload                   Atom = 0x47a07
	Progress                  Atom = 0x5ad08
	Prompt                    Atom = 0x52a06
	Public                    Atom = 0x57a06
	Q                         Atom = 0x7701
	Radiogroup                Atom = 0x30a
	Readonly                  Atom = 0x34b08
	Referrerpolicy            Atom = 0x3c50e
	Rel                       Atom = 0x47b03
	Required                  Atom = 0x23408
	Reversed                  Atom = 0x9c08
	Rows                      Atom = 0x3a04
	Rowspan                   Atom = 0x3a07
	Rp                        Atom = 0x22402
	Rt                        Atom = 0x17b02
	Ruby                      Atom = 0xac04
	S                         Atom = 0x2501
	Samp                      Atom = 0x4c04
	Sandbox                   Atom = 0xf307
	Scope                     Atom = 0x67105
	Scoped                    Atom = 0x67106
	Script                    Atom = 0x20006
	Seamless                  Atom = 0x36508
	Section                   Atom = 0x5bd07
	Select                    Atom = 0x63806
	Selected                  Atom = 0x63808
	Shape                     Atom = 0x1d505
	Size                      Atom = 0x5f104
	Sizes                     Atom = 0x5f105
	Slot                      Atom = 0x1df04
	Small                     Atom = 0x1ee05
	Sortable                  Atom = 0x64d08
	Sorted                    Atom = 0x32b06
	Source                    Atom = 0x36c06
	Spacer                    Atom = 0x42b06
	Span                      Atom = 0x3d04
	Spellcheck                Atom = 0x4680a
	Src                       Atom = 0x5b403
	Srcdoc                    Atom = 0x5b406
	Srclang                   Atom = 0x5f507
	Srcset                    Atom = 0x6f306
	Start                     Atom = 0x3ee05
	Step                      Atom = 0x57704
	Strike                    Atom = 0x7a06
	Strong                    Atom = 0x31506
	Style                     Atom = 0x6f905
	Sub                       Atom = 0x66903
	Summary                   Atom = 0x6fe07
	Sup                       Atom = 0x70503
	Svg                       Atom = 0x70803
	System                    Atom = 0x70b06
	Tabindex                  Atom = 0x4b208
	Table                     Atom = 0x58905
	Target                    Atom = 0x2ac06
	Tbody                     Atom = 0x2705
	Td                        Atom = 0x5e02
	Template                  Atom = 0x70e08
	Textarea                  Atom = 0x34608
	Tfoot                     Atom = 0xb205
	Th                        Atom = 0x13f02
	Thead                     Atom = 0x32405
	Time                      Atom = 0x11c04
	Title                     Atom = 0xca05
	Tr                        Atom = 0x7402
	Track                     Atom = 0x17c05
	Translate                 Atom = 0x1a609
	Tt                        Atom = 0x5102
	Type                      Atom = 0x8104
	Typemustmatch             Atom = 0x2780d
	U                         Atom = 0xb01
	Ul                        Atom = 0x6602
	Updateviacache            Atom = 0x1200e
	Usemap                    Atom = 0x59206
	Value                     Atom = 0x1505
	Var                       Atom = 0x15603
	Video                     Atom = 0x2d905
	Wbr                       Atom = 0x57003
	Width                     Atom = 0x64505
	Workertype                Atom = 0x7160a
	Wrap                      Atom = 0x72004
	Xmp                       Atom = 0xf903
)

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