{"modulePath":"github.com/nmintoh/dserver","version":"v5.1.2+incompatible","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package plugin\n\n## Types\n\n```go\ntype API interface {\n\t// Loads the plugin's configuration\n\tLoadPluginConfiguration(dest interface{}) error\n\n\t// The plugin's router\n\tPluginRouter() *mux.Router\n\n\t// Gets a team by its name\n\tGetTeamByName(name string) (*model.Team, *model.AppError)\n\n\t// Gets a user by its name\n\tGetUserByName(name string) (*model.User, *model.AppError)\n\n\t// Gets a channel by its name\n\tGetChannelByName(teamId, name string) (*model.Channel, *model.AppError)\n\n\t// Gets a direct message channel\n\tGetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)\n\n\t// Creates a post\n\tCreatePost(post *model.Post) (*model.Post, *model.AppError)\n\n\t// Get LDAP attributes for a user\n\tGetLdapUserAttributes(userId string, attributes []string) (map[string]string, *model.AppError)\n\n\t// Temporary for built-in plugins, copied from api4/context.go ServeHTTP function.\n\t// If a request has a valid token for an active session, the session is returned otherwise\n\t// it errors.\n\tGetSessionFromRequest(r *http.Request) (*model.Session, *model.AppError)\n\n\t// Returns a localized string. If a request is given, its headers will be used to pick a locale.\n\tI18n(id string, r *http.Request) string\n}\n```\n\n```go\ntype Base struct{}\n```\nBase provides default implementations for hooks.\n\n```go\nfunc (b *Base) OnConfigurationChange()\n```\n\n```go\ntype Hooks interface {\n\t// Invoked when configuration changes may have been made\n\tOnConfigurationChange()\n}\n```\nAll implementations should be safe for concurrent use.\n\n```go\ntype Plugin interface {\n\tInitialize(API)\n\tHooks\n}\n```\n\n","path":"github.com/nmintoh/dserver/app/plugin","name":"plugin","synopsis":"","isRedistributable":true}
