command

package
v0.0.0-...-0144ae3 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2016 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Fallback string `json:"fallback"`
	Color    Color  `json:"color"`
	Pretext  string `json:"pretext"`

	AuthorName string `json:"author_name"`
	AuthorLink string `json:"author_link"`
	AuthorIcon string `json:"author_icon"`

	Title     string `json:"title"`
	TitleLink string `json:"title_link"`

	Text string `json:"text"`

	ImageUrl string `json:"image_url"`
	ThumbUrl string `json:"thumb_url"`
}

type AttachmentField

type AttachmentField struct {
	// contains filtered or unexported fields
}

type Color

type Color struct {
	// contains filtered or unexported fields
}

func (Color) MarshalJSON

func (color Color) MarshalJSON() ([]byte, error)

func (Color) String

func (color Color) String() string

type CommandInfo

type CommandInfo map[string]*struct {
	Token string
	// "key=val" list
	Options []string
}

Each command processor info

user with gcfg

type CommandRuntimeInfo

type CommandRuntimeInfo struct {
	Token   string
	Handler interface{}
	Options map[string]string
}

Command processor info using at runtime

type CommandServer

type CommandServer struct {
	Common   CommandsInfo
	Command  CommandInfo
	Handlers map[string]*CommandRuntimeInfo
}

Command server object

func NewServer

func NewServer(commands CommandsInfo, command CommandInfo) *CommandServer

Create new server

func (*CommandServer) Start

func (server *CommandServer) Start(wg *sync.WaitGroup)

start server

type CommandsInfo

type CommandsInfo struct {
	Port int
}

Command server info

use with gcfg

type CurrencyQuery

type CurrencyQuery struct {
	XMLName xml.Name `xml:"query"`
	Rates   []struct {
		ID   string  `xml:"id,attr"`
		Rate float64 `xml:"Rate"`
	} `xml:"results>rate"`
}

type HandlerInitializer

type HandlerInitializer func(*map[string]string)

type Request

type Request struct {
	Token       string `param:"token"`
	TeamId      string `param:"team_id"`
	TeamDomain  string `param:"team_domain"`
	ChannelId   string `param:"channel_id"`
	ChannelName string `param:"channel_name"`
	UserId      string `param:"user_id"`
	UserName    string `param:"user_name"`
	Command     string `param:"command"`
	Text        string `param:"text"`
	ResponseUrl string `param:"response_url"`
}

type Response

type Response struct {
	ResponseType ResponseTypeEnum `json:"response_type"`
	Text         string           `json:"text"`
	Attachments  []Attachment     `json:"attachments"`
}

func CurrencyCommand

func CurrencyCommand(req Request) *Response

func EchoCommand

func EchoCommand(req Request) *Response

func NamuCommand

func NamuCommand(req Request) *Response

func ZzalCommand

func ZzalCommand(req Request) *Response

type ResponseTypeEnum

type ResponseTypeEnum int

func (ResponseTypeEnum) MarshalJSON

func (e ResponseTypeEnum) MarshalJSON() ([]byte, error)

func (ResponseTypeEnum) String

func (e ResponseTypeEnum) String() string

Jump to

Keyboard shortcuts

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