poster

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DMer

type DMer interface {
	// DM posts a simple Direct Message to the specified user
	DM(mattermostUserID, format string, args ...interface{}) (string, error)
}

DMer defines an entity that can send Direct Messages

type PostAPI

type PostAPI interface {
	DM(senderUserID, receiverUserID string, post *model.Post) error
	GetPost(postID string) (*model.Post, error)
	UpdatePost(post *model.Post) error
	DeletePost(postID string) error
	SendEphemeralPost(userID string, post *model.Post)
}

PostAPI defines the portion of the Post Service used by the poster

type Poster

type Poster interface {
	DMer

	// DMWithAttachments posts a Direct Message that contains Slack attachments.
	// Often used to include post actions.
	DMWithAttachments(mattermostUserID string, attachments ...*model.SlackAttachment) (string, error)

	// Ephemeral sends an ephemeral message to a user
	Ephemeral(mattermostUserID, channelID, format string, args ...interface{})

	// UpdatePostByID updates the post with postID with the formatted message
	UpdatePostByID(postID, format string, args ...interface{}) error

	// DeletePost deletes a single post
	DeletePost(postID string) error

	// DMUpdatePost substitute one post with another
	UpdatePost(post *model.Post) error

	// UpdatePosterID updates the Mattermost User ID of the poster
	UpdatePosterID(id string)
}

Poster defines an entity that can post DMs and Ephemerals and update and delete those posts

func NewPoster

func NewPoster(postAPI PostAPI, id string) Poster

NewPoster creates a new default poster

Directories

Path Synopsis
Package mock_import is a generated GoMock package.
Package mock_import is a generated GoMock package.

Jump to

Keyboard shortcuts

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