slack

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxConcurrentRequests = 1000

Variables

This section is empty.

Functions

This section is empty.

Types

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 added in v0.3.0

func (notifier *Notifier) Close() error

func (*Notifier) DispatchAccountUpdatedEvent added in v0.4.0

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

func (*Notifier) DispatchAccountWitnessVotedEvent added in v0.8.0

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 added in v0.3.0

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

func (*Notifier) DispatchUserFollowStatusChangedEvent added in v0.7.0

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

func (*Notifier) DispatchUserMentionedEvent added in v0.2.0

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

type NotifierOption

type NotifierOption func(*Notifier)

func SetMaxConcurrentRequests added in v0.3.0

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

Jump to

Keyboard shortcuts

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