dialog

package
v0.0.0-...-ba21cce Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(req *OpenRequest) error

Types

type Dialog

type Dialog struct {
	CallbackID  string     `json:"callback_id" url:"callback_id"`
	Title       string     `json:"title" url:"title"`
	SubmitLabel string     `json:"submit_label,omitempty" url:"submit_label,omitempty"`
	Elements    []*Element `json:"elements" url:"elements"`
}

ffjson: nodecoder

func (*Dialog) MarshalJSON

func (j *Dialog) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Dialog) MarshalJSONBuf

func (j *Dialog) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

type Element

type Element struct {
	Label       string          `json:"label" url:"label"`
	Name        string          `json:"name" url:"name"`
	Type        ElementType     `json:"type" url:"type"`
	SubType     ElementSubType  `json:"subtype,omitempty" url:"subtype,omitempty"`
	Optional    bool            `json:"optional,omitempty" url:"optional,omitempty"`
	Placeholder string          `json:"placeholder,omitempty" url:"placeholder,omitempty"`
	Value       string          `json:"value,omitempty" url:"value,omitempty"`
	Options     []*SelectOption `json:"options,omitempty" url:"options,omitempty"`
	Hint        string          `json:"hint,omitempty" url:"hint,omitempty"`
	MaxLength   int             `json:"max_length,omitempty" url:"max_length,omitempty"`
	MinLength   int             `json:"min_length,omitempty" url:"min_length,omitempty"`
}

ffjson: nodecoder

func (*Element) MarshalJSON

func (j *Element) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Element) MarshalJSONBuf

func (j *Element) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

type ElementSubType

type ElementSubType string
const (
	EmailElementSubType  ElementSubType = "email"
	TelElementSubType    ElementSubType = "tel"
	NumberElementSubType ElementSubType = "number"
	URLElementSubType    ElementSubType = "url"
)

type ElementType

type ElementType string
const (
	SelectElementType   ElementType = "select"
	TextElementType     ElementType = "text"
	TextAreaElementType ElementType = "textarea"
)

type Error

type Error struct {
	Name  string `json:"name" url:"name"`
	Error string `json:"error" url:"error"`
}

ffjson: nodecoder

func (*Error) MarshalJSON

func (j *Error) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*Error) MarshalJSONBuf

func (j *Error) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

type OpenRequest

type OpenRequest struct {
	Token     string  `json:"token" url:"token"`
	TriggerID string  `json:"trigger_id" url:"trigger_id"`
	Dialog    *Dialog `json:"dialog" url:"dialog"`
}

ffjson: nodecoder

func (*OpenRequest) MarshalJSON

func (j *OpenRequest) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*OpenRequest) MarshalJSONBuf

func (j *OpenRequest) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

type SelectOption

type SelectOption struct {
	Label string `json:"label" url:"label"`
	Value string `json:"value" url:"value"`
}

ffjson: nodecoder

func (*SelectOption) MarshalJSON

func (j *SelectOption) MarshalJSON() ([]byte, error)

MarshalJSON marshal bytes to json - template

func (*SelectOption) MarshalJSONBuf

func (j *SelectOption) MarshalJSONBuf(buf fflib.EncodingBuffer) error

MarshalJSONBuf marshal buff to json - template

Jump to

Keyboard shortcuts

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