plugin

package
v4.2.2-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: AGPL-3.0, Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	// Loads the plugin's configuration
	LoadPluginConfiguration(dest interface{}) error

	// The plugin's router
	PluginRouter() *mux.Router

	// Gets a team by its name
	GetTeamByName(name string) (*model.Team, *model.AppError)

	// Gets a user by its name
	GetUserByName(name string) (*model.User, *model.AppError)

	// Gets a channel by its name
	GetChannelByName(teamId, name string) (*model.Channel, *model.AppError)

	// Gets a direct message channel
	GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)

	// Creates a post
	CreatePost(post *model.Post) (*model.Post, *model.AppError)

	// Get LDAP attributes for a user
	GetLdapUserAttributes(userId string, attributes []string) (map[string]string, *model.AppError)

	// Temporary for built-in plugins, copied from api4/context.go ServeHTTP function.
	// If a request has a valid token for an active session, the session is returned otherwise
	// it errors.
	GetSessionFromRequest(r *http.Request) (*model.Session, *model.AppError)

	// Returns a localized string. If a request is given, its headers will be used to pick a locale.
	I18n(id string, r *http.Request) string
}

type Base

type Base struct{}

Base provides default implementations for hooks.

func (*Base) OnConfigurationChange

func (b *Base) OnConfigurationChange()

type Hooks

type Hooks interface {
	// Invoked when configuration changes may have been made
	OnConfigurationChange()
}

All implementations should be safe for concurrent use.

type Plugin

type Plugin interface {
	Initialize(API)
	Hooks
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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