api

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	KeepFetchingMessages FetchMessagesConditionFunc
	KeepFetchingReplies  FetchMessagesConditionFunc
	// contains filtered or unexported fields
}

Client represents API client.

func New

func New(botToken, userToken string) *Client

New returns prepared API client.

func (*Client) FetchChannels

func (c *Client) FetchChannels(ctx context.Context, tx boil.ContextTransactor) error

fetchChannels fetches and saves channels.

func (*Client) FetchMessages

func (c *Client) FetchMessages(ctx context.Context, tx boil.ContextTransactor, channelID string) error

FetchMessages fetches and saves messages.

func (*Client) FetchUsers

func (c *Client) FetchUsers(ctx context.Context, tx boil.ContextTransactor) error

FetchUsers fetches and saves users.

func (*Client) SetLogger

func (c *Client) SetLogger(w io.Writer)

SetLogger sets logger for debugging.

func (*Client) UpsertChannel added in v0.2.0

func (c *Client) UpsertChannel(ctx context.Context, tx boil.ContextTransactor, channel slack.Channel) error

UpsertChannel updates or inserts given channel into database.

func (*Client) UpsertFile added in v0.2.2

func (c *Client) UpsertFile(ctx context.Context, tx boil.ContextTransactor, file slack.File) error

UpsertFile updates or inserts given file into database.

func (*Client) UpsertMessage added in v0.2.0

func (c *Client) UpsertMessage(ctx context.Context, tx boil.ContextTransactor, message slack.Message) error

UpsertMessage updates or inserts given message into database.

func (*Client) UpsertMessageFile added in v0.2.2

func (c *Client) UpsertMessageFile(ctx context.Context, tx boil.ContextTransactor, messageTimestamp string, file slack.File) error

UpsertMessageFile updates or inserts given file into database.

func (*Client) UpsertUser added in v0.2.0

func (c *Client) UpsertUser(ctx context.Context, tx boil.ContextTransactor, user slack.User) error

UpsertUser updates or inserts given user into database.

func (*Client) Whoami

func (c *Client) Whoami() (botName, botID, userName, userID string, err error)

Whoami returns login user identities.

type FetchMessagesConditionFunc

type FetchMessagesConditionFunc func(fetchedMessageCount int, messages []slack.Message) (keepFetching bool)

FetchMessagesConditionFunc is a function which indicates continuation. Fetching is performed while this function returns true.

Jump to

Keyboard shortcuts

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