format

package
v0.0.0-...-9cd47dc Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Title     string `json:"title"`
	TitleLink string `json:"title_link"`
	Text      string `json:"text"`
	ImageURL  string `json:"image_url"`
	Color     string `json:"color"`
}

Attachment of the rocket.chat message

type ConsoleFormatter

type ConsoleFormatter struct {
}

ConsoleFormatter displays output in console

func (*ConsoleFormatter) Format

func (f *ConsoleFormatter) Format(lineNb int, s *traffic.Status, tweets []twitter.Tweet)

Format the output in console

type Formatter

type Formatter interface {
	Format(lineNb int, s *traffic.Status, tweets []twitter.Tweet)
}

Formatter displays output

type JSONFormatter

type JSONFormatter struct {
}

JSONFormatter displays the output in JSON

func (*JSONFormatter) Format

func (f *JSONFormatter) Format(lineNb int, s *traffic.Status, tweets []twitter.Tweet)

Format the output in JSON

type RocketChatFormatter

type RocketChatFormatter struct {
	Webhook string
}

RocketChatFormatter sends a webhook to rocket.chat

func (*RocketChatFormatter) Format

func (f *RocketChatFormatter) Format(lineNb int, s *traffic.Status, tweets []twitter.Tweet)

Format the commuting status info by sending a webhook to rocket.chat

type RocketChatMessage

type RocketChatMessage struct {
	IconEmoji   string       `json:"icon_emoji"`
	Text        string       `json:"text"`
	Attachments []Attachment `json:"attachments"`
}

RocketChatMessage is the message to send to rocket chat

Jump to

Keyboard shortcuts

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