elements

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (

	//SparklineLine is a flag for an chart type using lines
	SparklineLine = iota

	//SparklineBar is a flag for an chart type using bar
	SparklineBar

	//SparklineTristate is a flag for an chart type using tristate
	SparklineTristate

	//SparklineDiscrete is a flag for an chart type using discrete
	SparklineDiscrete

	//SparklineBullet is a flag for an chart type using Bullet
	SparklineBullet

	//SparklinePie is a flag for an chart type using pie
	SparklinePie

	//SparklineBox is a flag for an chart type using box
	SparklineBox
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID      string
	Classes []string
	Style   map[string]string
	Data    map[string]string
}

Base is an type base for all elements. This means that all Elements can use the attributes listed below.

func (*Base) AddClass

func (base *Base) AddClass(class string)

AddClass add a new class string for element

func (Base) Attrs

func (base Base) Attrs() string

Attrs return string for ID, class info and style

func (*Base) RemoveClass

func (base *Base) RemoveClass(class string)

RemoveClass delete an class string in Classes slice

func (*Base) RemoveData

func (base *Base) RemoveData(key string)

RemoveData delete a value in Data map

func (*Base) RemoveStyle

func (base *Base) RemoveStyle(key string)

RemoveStyle delete a value in Style map

func (*Base) SetData

func (base *Base) SetData(key string, value string)

SetData set a data value for a key

func (*Base) SetStyle

func (base *Base) SetStyle(key string, value string)

SetStyle set a style value for a key

type Break

type Break struct {
	Base
}

Break produce the element br

func (Break) String

func (b Break) String() string

String return string tag for Break

type Button

type Button struct {
	Base
	Text       string
	HTMLEncode bool
	PostBack   []string
}

Button element produces an HTML button

func (Button) String

func (btn Button) String() string

String return a string with button

type Container

type Container struct {
	Body []Element
}

Container is an base to elements with body

func (*Container) AddElement

func (c *Container) AddElement(el Element)

AddElement put a new element on Body

type Element

type Element interface {
	String() string
}

Element is an interface for html components

type Heading1

type Heading1 struct {
	Base
	Text string
}

Heading1 element produces an HTML heading element (<h1>)

func (Heading1) String

func (h1 Heading1) String() string

String emit html text for Heading1

type Heading2

type Heading2 struct {
	Base
	Text string
}

Heading2 element produces an HTML heading element (<h1>)

func (Heading2) String

func (h2 Heading2) String() string

String emit html text for Heading2

type Heading3

type Heading3 struct {
	Base
	Text string
}

Heading3 element produces an HTML heading element (<h1>)

func (Heading3) String

func (h3 Heading3) String() string

String emit html text for Heading3

type Heading4

type Heading4 struct {
	Base
	Text string
}

Heading4 element produces an HTML heading element (<h1>)

func (Heading4) String

func (h4 Heading4) String() string

String emit html text for Heading4

type HorizontalRule

type HorizontalRule struct {
	Base
}

HorizontalRule produce the hr tag

func (HorizontalRule) String

func (hr HorizontalRule) String() string

String implements element interface into HorizontalRule

type Image

type Image struct {
	Base
	Source string
}

Image produce the img html element

func (Image) String

func (image Image) String() string

String return img tag

type InputPassword added in v0.1.2

type InputPassword struct {
	Base
}

InputPassword element produces an HTML password input

func (InputPassword) String added in v0.1.2

func (pass InputPassword) String() string

String return a string with input password

type InputText added in v0.1.2

type InputText struct {
	Base
	Value string
}

InputText element produces an HTML text input

func (InputText) String added in v0.1.2

func (text InputText) String() string

String return a string with input text

type Link struct {
	Base
	Container
	Text       string
	HTMLEncode bool
	URL        string
	NewWindow  bool
	PostBack   []string
}

Link produce the html anchor

func (Link) String

func (link Link) String() string

String return a string with tag anchor

type List

type List struct {
	Base
	Container
	Numbered bool
	Role     string
}

List element produces an HTML list element (<ol> and <ul>).

func (List) String

func (l List) String() string

String return string to ul or ol tag

type ListItem

type ListItem struct {
	Base
	Container
	Text       string
	HTMLEncode bool
}

ListItem produces an HTML listitem element (<li>).

func (ListItem) String

func (li ListItem) String() string

String return string to li tag

type Panel

type Panel struct {
	Base
	Container
	Text       string
	HTMLEncode bool
}

Panel element produces an HTML div

func (Panel) String

func (panel Panel) String() string

String emit text for Panel

type Paragraph

type Paragraph struct {
	Base
	Text       string
	HTMLEncode bool
}

Paragraph element produces an HTML p

func (Paragraph) String

func (p Paragraph) String() string

String return the string to p tag

type RawElement added in v0.1.3

type RawElement struct {
	Raw string
}

RawElement is an elementa to return raw html code

func (*RawElement) String added in v0.1.3

func (raw *RawElement) String() string

String emit html text for RawElement

type Span

type Span struct {
	Base
	Container
	Text       string
	HTMLEncode bool
}

Span element produces an HTML span

func (Span) String

func (span Span) String() string

String emit text for span

type Sparkline added in v0.1.2

type Sparkline struct {
	Base
	Type    string
	Values  []int
	Options map[string]string
}

Sparkline produce the sparkline element

func (*Sparkline) RemoveOption added in v0.1.2

func (spark *Sparkline) RemoveOption(key string)

RemoveOption delete a value in Data map

func (*Sparkline) SetOption added in v0.1.2

func (spark *Sparkline) SetOption(key string, value string)

SetOption set a option value for a key

func (Sparkline) String added in v0.1.2

func (spark Sparkline) String() string

String return string tag for Sparkline

type TextArea

type TextArea struct {
	Base
	Text string
}

TextArea element produces an HTML textarea

func (TextArea) String

func (ta TextArea) String() string

String return the string to textarea tag

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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