slackutil

package
v0.0.0-...-f2600a7 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHistoryParams

func GetHistoryParams(beginTimestamp, endTimestamp time.Time) *slack.HistoryParameters

Returns `HistoryParameters` with Oldest and Latest set to the given time range.

func IsInterestedMessage

func IsInterestedMessage(m slack.Message) bool

Returns true if it's the top most message.

func PrintMessagesToStdoutAsNdjson

func PrintMessagesToStdoutAsNdjson(channelName string, buf []slack.Message)

Print messages to Stdout so that it can be redirected to temp.log, which will later be sent to ElasticSearch.

func ReadMessages

func ReadMessages(api *slack.Client, channelId string, historyParams *slack.HistoryParameters,
) []slack.Message

Returns the messages posted in channel.

func ToUnixSeconds

func ToUnixSeconds(m *slack.Message) string

Extracts unix seconds from the slack message. (not safe).

Types

type ChannelMessages

type ChannelMessages struct {
	Channel string `json:"channel"`
	// unix epoch
	Datetime string         `json:"datetime"`
	Message  *slack.Message `json:"message"`
}

Final export format.

type ChannelsValue

type ChannelsValue struct {
	Channels map[string]bool
}

This is used as a flag fed to the CLI. For example,

--flags=general,bots,...

func (ChannelsValue) Set

func (s ChannelsValue) Set(value string) error

Set defines how to parse flag value and populates its own fields.

func (ChannelsValue) String

func (s ChannelsValue) String() string

type ElasticSearchAction

type ElasticSearchAction struct {
	Index  *ElasticSearchActionIndex `json:"index,omitempty"`
	Create *ElasticSearchActionIndex `json:"create,omitempty"`
	Delete *ElasticSearchActionIndex `json:"delete,omitempty"`
}

This represetns an action/command row in the ndjson format sent to ElasticSearch.

type ElasticSearchActionIndex

type ElasticSearchActionIndex struct {
	Id    string `json:"_id,omitempty"`
	Index string `json:"_index,omitempty"`
}

Jump to

Keyboard shortcuts

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