plugin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WSEventConfigUpdate = "config_update"
)

Variables

This section is empty.

Functions

func GetDMPost

func GetDMPost(botID string, comment *drive.Comment, file *drive.File, siteURL string) *mattermostModel.Post

func GetSampleChangeList

func GetSampleChangeList() *drive.ChangeList

func GetSampleComment

func GetSampleComment(commentID string) *drive.Comment

func GetSampleDoc

func GetSampleDoc() *docs.Document

func GetSampleDriveactivityCommentResponse

func GetSampleDriveactivityCommentResponse() *driveactivity.QueryDriveActivityResponse

func GetSampleDriveactivityPermissionResponse

func GetSampleDriveactivityPermissionResponse() *driveactivity.QueryDriveActivityResponse

func GetSampleFile

func GetSampleFile(fileID string) *drive.File

func GetSamplePresentation

func GetSamplePresentation() *slides.Presentation

func GetSampleSheet

func GetSampleSheet() *sheets.Spreadsheet

func GetSampleWatchChannelData

func GetSampleWatchChannelData() *model.WatchChannelData

Types

type APIErrorResponse

type APIErrorResponse struct {
	ID         string `json:"id"`
	Message    string `json:"message"`
	StatusCode int    `json:"status_code"`
}

func (*APIErrorResponse) Error

func (e *APIErrorResponse) Error() string

type CommandHandleFunc

type CommandHandleFunc func(c *plugin.Context, args *model.CommandArgs, parameters []string) string

type Context

type Context struct {
	Ctx    context.Context
	UserID string
	Log    logger.Logger
}

type DialogErrorResponse

type DialogErrorResponse struct {
	Error      string `json:"error"`
	StatusCode int    `json:"status_code"`
}

DialogErrorResponse is an error response used in interactive dialogs

type FileCreationRequest

type FileCreationRequest struct {
	Name           string `json:"name"`
	FileAccess     string `json:"file_access"`
	Message        string `json:"message"`
	ShareInChannel bool   `json:"share_in_channel"`
}

type FlowManager

type FlowManager struct {
	// contains filtered or unexported fields
}

func (*FlowManager) StartAnnouncementWizard

func (fm *FlowManager) StartAnnouncementWizard(userID string) error

func (*FlowManager) StartOauthWizard

func (fm *FlowManager) StartOauthWizard(userID string) error

func (*FlowManager) StartSetupWizard

func (fm *FlowManager) StartSetupWizard(userID string) error

type HTTPHandlerFuncWithContext

type HTTPHandlerFuncWithContext func(c *Context, w http.ResponseWriter, r *http.Request)

HTTPHandlerFuncWithContext is http.HandleFunc but with a Context attached

type MockSetup

type MockSetup struct {
	MockKVStore       *mock_store.MockKVStore
	MockGoogleClient  *mock_google.MockClientInterface
	MockGoogleDrive   *mock_google.MockDriveInterface
	MockDriveActivity *mock_google.MockDriveActivityInterface
	MockGoogleDocs    *mock_google.MockDocsInterface
	MockGoogleSheets  *mock_google.MockSheetsInterface
	MockGoogleSlides  *mock_google.MockSlidesInterface
	MockClusterMutex  *mock_pluginapi.MockClusterMutex
	MockCluster       *mock_pluginapi.MockCluster
	MockOAuth2        *mock_oauth2.MockConfig
	MockTelemetry     *mock_pluginapi.MockTracker
}

func GetMockSetup

func GetMockSetup(t *testing.T) *MockSetup

type OAuthBroker

type OAuthBroker struct {
	// contains filtered or unexported fields
}

func NewOAuthBroker

func NewOAuthBroker(sendOAuthCompleteEvent func(event OAuthCompleteEvent)) *OAuthBroker

func (*OAuthBroker) Close

func (ob *OAuthBroker) Close()

func (*OAuthBroker) SubscribeOAuthComplete

func (ob *OAuthBroker) SubscribeOAuthComplete(userID string) <-chan error

func (*OAuthBroker) UnsubscribeOAuthComplete

func (ob *OAuthBroker) UnsubscribeOAuthComplete(userID string, ch <-chan error)

type OAuthCompleteEvent

type OAuthCompleteEvent struct {
	UserID string
	Err    error
}

type Plugin

type Plugin struct {
	plugin.MattermostPlugin

	Client  *pluginapi.Client
	KVStore kvstore.KVStore

	BotUserID string

	CommandHandlers map[string]CommandHandleFunc

	FlowManager *FlowManager

	GoogleClient google.ClientInterface
	// contains filtered or unexported fields
}

Plugin implements the interface expected by the Mattermost server to communicate between the server and plugin processes.

func NewPlugin

func NewPlugin() *Plugin

func (*Plugin) ExecuteCommand

func (p *Plugin) ExecuteCommand(c *plugin.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError)

func (*Plugin) HandleClusterEvent

func (p *Plugin) HandleClusterEvent(ev model.PluginClusterEvent)

func (*Plugin) NewFlowManager

func (p *Plugin) NewFlowManager() *FlowManager

func (*Plugin) OnActivate

func (p *Plugin) OnActivate() error

func (*Plugin) OnConfigurationChange

func (p *Plugin) OnConfigurationChange() error

OnConfigurationChange is invoked when configuration changes may have been made.

func (*Plugin) OnDeactivate

func (p *Plugin) OnDeactivate() error

func (*Plugin) OnInstall

func (p *Plugin) OnInstall(c *plugin.Context, event mattermostModel.OnInstallEvent) error

func (*Plugin) OnPluginClusterEvent

func (p *Plugin) OnPluginClusterEvent(c *plugin.Context, ev mattermostModel.PluginClusterEvent)

func (*Plugin) OnSendDailyTelemetry

func (p *Plugin) OnSendDailyTelemetry()

func (*Plugin) SendDailyTelemetry

func (p *Plugin) SendDailyTelemetry()

func (*Plugin) ServeHTTP

func (p *Plugin) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)

func (*Plugin) TrackEvent

func (p *Plugin) TrackEvent(event string, properties map[string]interface{})

func (*Plugin) TrackUserEvent

func (p *Plugin) TrackUserEvent(event, userID string, properties map[string]interface{})

type ResponseType

type ResponseType string

ResponseType indicates type of response returned by api

const (
	// ResponseTypeJSON indicates that response type is json
	ResponseTypeJSON ResponseType = "JSON_RESPONSE"
	// ResponseTypePlain indicates that response type is text plain
	ResponseTypePlain ResponseType = "TEXT_RESPONSE"

	APIErrorIDNotConnected = "not_connected"
)

type TestEnvironment

type TestEnvironment struct {
	// contains filtered or unexported fields
}

func SetupTestEnvironment

func SetupTestEnvironment(t *testing.T) *TestEnvironment

func (*TestEnvironment) Cleanup

func (e *TestEnvironment) Cleanup(t *testing.T)

func (*TestEnvironment) ResetMocks

func (e *TestEnvironment) ResetMocks(t *testing.T)

type Tracker

type Tracker interface {
	TrackUserEvent(event, userID string, properties map[string]interface{})
}

Directories

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

Jump to

Keyboard shortcuts

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