util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultExtension = "json"
)

Variables

This section is empty.

Functions

func ExampleDataRaw

func ExampleDataRaw() []byte

Types

type Attachment

type Attachment struct {
	Title    string   `json:"title,omitempty"`
	Pretext  string   `json:"pretext,omitempty"`
	Text     string   `json:"text,omitempty"`
	MrkdwnIn []string `json:"mrkdwn_in,omitempty"`
	Fields   []Field  `json:"fields,omitempty"`
}

func NewAttachment

func NewAttachment() Attachment

func (*Attachment) AddField

func (attach *Attachment) AddField(field Field)

type ExampleData

type ExampleData struct {
	Data map[string]ExampleSource `json:"data,omitempty"`
}

func NewExampleData

func NewExampleData() (ExampleData, error)

func (*ExampleData) BuildFilename

func (data *ExampleData) BuildFilename(handlerKey string, eventSlug string) string

func (*ExampleData) ExampleMessageBytes

func (data *ExampleData) ExampleMessageBytes(handlerKey string, eventSlug string) ([]byte, error)

type ExampleSource

type ExampleSource struct {
	FileExtension string   `json:"file_extension,omitempty"`
	EventSlugs    []string `json:"event_slugs,omitempty"`
}

type Field

type Field struct {
	Title string `json:"title,omitempty"`
	Value string `json:"value,omitempty"`
	Short bool   `json:"short,omitempty"`
}

type Message

type Message struct {
	Activity    string       `json:"activity,omitempty"`
	IconEmoji   string       `json:"icon_emoji,omitempty"`
	IconURL     string       `json:"icon_url,omitempty"`
	Title       string       `json:"title,omitempty"`
	Text        string       `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

func NewMessage

func NewMessage() Message

func (*Message) AddAttachment

func (msg *Message) AddAttachment(att Attachment)

Jump to

Keyboard shortcuts

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