Back to godoc.org

Package slack

v0.8.0
Latest Go to latest

The latest major version is .

Published: Aug 17, 2016 | License: MIT | Module: github.com/tchap/steemwatch

Index

Constants

const DefaultMaxConcurrentRequests = 1000

type Attachment

type Attachment struct {
	Fallback   string   `json:"fallback"`
	Color      string   `json:"color,omitempty"`
	Pretext    string   `json:"pretext,omitempty"`
	AuthorName string   `json:"author_name,omitempty"`
	AuthorLink string   `json:"author_link,omitempty"`
	AuthorIcon string   `json:"author_icon,omitempty"`
	Title      string   `json:"title,omitempty"`
	TitleLink  string   `json:"title_link,omitempty"`
	Text       string   `json:"text,omitempty"`
	Fields     []*Field `json:"fields,omitempty"`
	ImageURL   string   `json:"image_url,omitempty"`
	ThumbURL   string   `json:"thumb_url,omitempty"`
	Footer     string   `json:"footer,omitempty"`
	FooterIcon string   `json:"footer_icon,omitempty"`
	Timestamp  uint64   `json:"ts,omitempty"`
}

type Field

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

type Notifier

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

func NewNotifier

func NewNotifier(opts ...NotifierOption) *Notifier

func (*Notifier) Close

func (notifier *Notifier) Close() error

func (*Notifier) DispatchAccountUpdatedEvent

func (notifier *Notifier) DispatchAccountUpdatedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.AccountUpdated,
) error

func (*Notifier) DispatchAccountWitnessVotedEvent

func (notifier *Notifier) DispatchAccountWitnessVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.AccountWitnessVoted,
) error

func (*Notifier) DispatchCommentPublishedEvent

func (notifier *Notifier) DispatchCommentPublishedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.CommentPublished,
) error

func (*Notifier) DispatchCommentVotedEvent

func (notifier *Notifier) DispatchCommentVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.CommentVoted,
) error

func (*Notifier) DispatchStoryPublishedEvent

func (notifier *Notifier) DispatchStoryPublishedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.StoryPublished,
) error

func (*Notifier) DispatchStoryVotedEvent

func (notifier *Notifier) DispatchStoryVotedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.StoryVoted,
) error

func (*Notifier) DispatchTransferMadeEvent

func (notifier *Notifier) DispatchTransferMadeEvent(
	userId string,
	userSettings bson.Raw,
	event *events.TransferMade,
) error

func (*Notifier) DispatchUserFollowStatusChangedEvent

func (notifier *Notifier) DispatchUserFollowStatusChangedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.UserFollowStatusChanged,
) error

func (*Notifier) DispatchUserMentionedEvent

func (notifier *Notifier) DispatchUserMentionedEvent(
	userId string,
	userSettings bson.Raw,
	event *events.UserMentioned,
) error

type NotifierOption

type NotifierOption func(*Notifier)

func SetMaxConcurrentRequests

func SetMaxConcurrentRequests(maxConcurrentRequests uint) NotifierOption

func SetWebhookTimeout

func SetWebhookTimeout(timeout time.Duration) NotifierOption

type Payload

type Payload struct {
	Text        string        `json:"text,omitempty"`
	Attachments []*Attachment `json:"attachments,omitempty"`
}

type Settings

type Settings struct {
	WebhookURL string `bson:"webhookURL"`
}

func UnmarshalSettings

func UnmarshalSettings(userId string, raw bson.Raw) (*Settings, error)

func (*Settings) Validate

func (settings *Settings) Validate() error

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier