template

package
v0.0.0-...-852b98d Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2018 License: Apache-2.0 Imports: 1 Imported by: 6

Documentation

Index

Constants

View Source
const (
	PLAIN_TEXT = "PlainText"
	RICH_TEXT  = "RichText"
)
View Source
const (
	BOTTOM_LEFT_POSITION = "BOTTOM-LEFT"
	CENTER               = "CENTER"
	TOP_LEFT             = "TOP-LEFT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseTemplate

type BaseTemplate struct {
	directive.BaseDirective
	Token           string `json:"token"`
	BackgroundImage *Image `json:"backgroundImage,omitempty"`
	Title           string `json:"title"`
}

func (*BaseTemplate) SetBackgroundImage

func (this *BaseTemplate) SetBackgroundImage(background *Image)

func (*BaseTemplate) SetBackgroundImageUrl

func (this *BaseTemplate) SetBackgroundImageUrl(url string)

func (*BaseTemplate) SetTitle

func (this *BaseTemplate) SetTitle(title string)

type BodyTemplate1

type BodyTemplate1 struct {
	BaseTemplate
	TextContent struct {
		Position string `json:"position"`
		Text     *Text  `json:"text"`
	} `json:"textContent"`
}

func NewBodyTemplate1

func NewBodyTemplate1() *BodyTemplate1

func (*BodyTemplate1) SetContentPosition

func (this *BodyTemplate1) SetContentPosition(position string) *BodyTemplate1

func (*BodyTemplate1) SetPlainContent

func (this *BodyTemplate1) SetPlainContent(content string) *BodyTemplate1

type BodyTemplate2

type BodyTemplate2 struct {
	TextImageTemplate
}

func NewBodyTemplate2

func NewBodyTemplate2() *BodyTemplate2

type BodyTemplate3

type BodyTemplate3 struct {
	TextImageTemplate
}

func NewBodyTemplate3

func NewBodyTemplate3() *BodyTemplate3

type BodyTemplate4

type BodyTemplate4 struct {
	TextImageTemplate
}

func NewBodyTemplate4

func NewBodyTemplate4() *BodyTemplate4

type BodyTemplate5

type BodyTemplate5 struct {
	BaseTemplate
	Images []*Image `json:"images"`
}

func NewBodyTemplate5

func NewBodyTemplate5() *BodyTemplate5

func (*BodyTemplate5) AddImage

func (this *BodyTemplate5) AddImage(image *Image) *BodyTemplate5

type Image

type Image struct {
	Url          string `json:"url"`
	WidthPixels  int    `json:"widthPixels,omitempty"`
	HeightPixels int    `json:"heightPixels,omitempty"`
}

func NewImage

func NewImage(url string) *Image

func (*Image) SetHeight

func (this *Image) SetHeight(height int) *Image

func (*Image) SetWidth

func (this *Image) SetWidth(width int) *Image

type ListItem

type ListItem struct {
	Token       string `json:"token"`
	Image       *Image `json:"image,omitempty"`
	TextContent struct {
		PrimaryText   *Text `json:"primaryText"`
		SecondaryText *Text `json:"secondaryText"`
		TertiaryText  *Text `json:"tertiaryText,omitempty"`
	} `json:"textContent"`
}

func NewListItem

func NewListItem() *ListItem

func (*ListItem) SetImage

func (this *ListItem) SetImage(image *Image) *ListItem

func (*ListItem) SetImageUrl

func (this *ListItem) SetImageUrl(url string) *ListItem

func (*ListItem) SetPlainPrimaryText

func (this *ListItem) SetPlainPrimaryText(text string) *ListItem

func (*ListItem) SetPlainSecondaryText

func (this *ListItem) SetPlainSecondaryText(text string) *ListItem

func (*ListItem) SetPlainTertiary

func (this *ListItem) SetPlainTertiary(text string) *ListItem

type ListTemplate

type ListTemplate struct {
	BaseTemplate
	ListItems []*ListItem `json:"listItems"`
}

func (*ListTemplate) AddItem

func (this *ListTemplate) AddItem(listItem *ListItem)

type ListTemplate1

type ListTemplate1 struct {
	ListTemplate
}

func NewListTemplate1

func NewListTemplate1() *ListTemplate1

type ListTemplate2

type ListTemplate2 struct {
	ListTemplate
}

func NewListTemplate2

func NewListTemplate2() *ListTemplate2

type Text

type Text struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

func NewText

func NewText(textType, text string) *Text

type TextImageTemplate

type TextImageTemplate struct {
	BaseTemplate
	Content *Text  `json:"content"`
	Image   *Image `json:"image"`
}

func (*TextImageTemplate) SetImage

func (this *TextImageTemplate) SetImage(image *Image)

func (*TextImageTemplate) SetImageUrl

func (this *TextImageTemplate) SetImageUrl(url string)

func (*TextImageTemplate) SetPlainContent

func (this *TextImageTemplate) SetPlainContent(content string)

Jump to

Keyboard shortcuts

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