connection

package
v0.11.0-rc.6 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package connection represents communication channels.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtifactLoader

type ArtifactLoader interface {
	// AddArtifact describes a method for an uploading message artifacts to a communication channel.
	AddArtifact(name string, result string, channelID string, messageID string) (artifactLink string, err error)

	// DownloadArtifact describes a method for a downloading message artifacts and snippets from a communication channel.
	DownloadArtifact(artifactURL string) (response []byte, err error)
}

MessageValidator defines the interface for artifacts management.

type Assistant

type Assistant interface {
	// Init defines the method to initialize the assistant.
	Init() error

	// Register defines the method to register the assistant.
	Register(ctx context.Context) error

	// Deregister defines the method to deregister the assistant.
	Deregister(ctx context.Context) error

	// RestoreSessions checks sessions after restart and establishes DB connection
	RestoreSessions(context.Context) error

	// CheckIdleSessions defines the method for checking user idle sessions and notification about them.
	CheckIdleSessions(context.Context)

	// AddChannel adds a new Database Lab instance to communication via the assistant.
	AddChannel(channelID string, dbLabInstance *dblab.Instance)

	// DumpSessions iterates over channels and collects user's sessions to storage
	DumpSessions()
}

Assistant defines the interface of a Query Optimization assistant.

type MessageFinalizer

type MessageFinalizer interface {
	// TODO(akartasov): Group Fail and OK methods to Finish(message *structs.Message) error
	// Fail finishes a message processing and marks a message as failed.
	Fail(message *models.Message, text string) error

	// OK finishes a message processing and marks a message as succeeding.
	OK(message *models.Message) error
}

MessageFinalizer finishes a message processing.

type MessageProcessor

type MessageProcessor interface {
	// ProcessMessageEvent defines the method for processing of incoming messages.
	ProcessMessageEvent(context.Context, models.IncomingMessage)

	// ProcessAppMentionEvent defines the method for replying to an application mention event.
	ProcessAppMentionEvent(incomingMessage models.IncomingMessage)

	// RestoreSessions checks sessions after restart and establishes DB connection
	RestoreSessions(ctx context.Context) error

	// Users returns user's session data
	Users() usermanager.UserList

	// CheckIdleSessions defines the method of check idleness sessions.
	CheckIdleSessions(ctx context.Context)
}

MessageProcessor defines the interface of a message processor.

type MessageValidator

type MessageValidator interface {
	// Validate validates an incoming message.
	Validate(inputEvent *models.IncomingMessage) error
}

MessageValidator defines the interface for message validation.

type Messenger

type Messenger interface {
	// Publish describes a method for posting of various type messages.
	Publish(message *models.Message) error

	// UpdateText describes a method for updating a message text.
	UpdateText(message *models.Message) error

	// UpdateStatus describes a method for changing a message status.
	UpdateStatus(message *models.Message, status models.MessageStatus) error

	MessageFinalizer
	ArtifactLoader
}

Messenger defines the interface for communication with an assistant.

Directories

Path Synopsis
Package slack provides the Slack implementation of the communication interface.
Package slack provides the Slack implementation of the communication interface.
Package slackrtm provides the Slack implementation of the communication interface.
Package slackrtm provides the Slack implementation of the communication interface.
Package slacksm provides the Slack SocketMode implementation of the communication interface.
Package slacksm provides the Slack SocketMode implementation of the communication interface.
Package webui provides the Web-UI implementation of the communication interface.
Package webui provides the Web-UI implementation of the communication interface.

Jump to

Keyboard shortcuts

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