summaryrefslogtreecommitdiffstats
path: root/plugin/api.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-09-21 14:00:14 -0500
committerGitHub <noreply@github.com>2017-09-21 14:00:14 -0500
commite525383c52b0c65ad3b3f6cdbee73f56e1e3f67d (patch)
treee46d2dcd0dcad346da8641f4bd62f9134bc80699 /plugin/api.go
parent266ff8670244da288aec937320d9eecc7996af35 (diff)
downloadchat-e525383c52b0c65ad3b3f6cdbee73f56e1e3f67d.tar.gz
chat-e525383c52b0c65ad3b3f6cdbee73f56e1e3f67d.tar.bz2
chat-e525383c52b0c65ad3b3f6cdbee73f56e1e3f67d.zip
plugin CRUD operations for users, posts, channels, and teams (#7479)
Diffstat (limited to 'plugin/api.go')
-rw-r--r--plugin/api.go58
1 files changed, 56 insertions, 2 deletions
diff --git a/plugin/api.go b/plugin/api.go
index 00361ff40..4df6cb30a 100644
--- a/plugin/api.go
+++ b/plugin/api.go
@@ -9,15 +9,69 @@ type API interface {
// struct that the configuration JSON can be unmarshalled to.
LoadPluginConfiguration(dest interface{}) error
- // GetTeamByName gets a team by its name.
- GetTeamByName(name string) (*model.Team, *model.AppError)
+ // CreateUser creates a user.
+ CreateUser(user *model.User) (*model.User, *model.AppError)
+
+ // DeleteUser deletes a user.
+ DeleteUser(userId string) *model.AppError
+
+ // GetUser gets a user.
+ GetUser(userId string) (*model.User, *model.AppError)
+
+ // GetUserByEmail gets a user by their email address.
+ GetUserByEmail(email string) (*model.User, *model.AppError)
// GetUserByUsername gets a user by their username.
GetUserByUsername(name string) (*model.User, *model.AppError)
+ // UpdateUser updates a user.
+ UpdateUser(user *model.User) (*model.User, *model.AppError)
+
+ // CreateTeam creates a team.
+ CreateTeam(team *model.Team) (*model.Team, *model.AppError)
+
+ // DeleteTeam deletes a team.
+ DeleteTeam(teamId string) *model.AppError
+
+ // GetTeam gets a team.
+ GetTeam(teamId string) (*model.Team, *model.AppError)
+
+ // GetTeamByName gets a team by its name.
+ GetTeamByName(name string) (*model.Team, *model.AppError)
+
+ // UpdateTeam updates a team.
+ UpdateTeam(team *model.Team) (*model.Team, *model.AppError)
+
+ // CreateChannel creates a channel.
+ CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
+
+ // DeleteChannel deletes a channel.
+ DeleteChannel(channelId string) *model.AppError
+
+ // GetChannel gets a channel.
+ GetChannel(channelId string) (*model.Channel, *model.AppError)
+
// GetChannelByName gets a channel by its name.
GetChannelByName(name, teamId string) (*model.Channel, *model.AppError)
+ // GetDirectChannel gets a direct message channel.
+ GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError)
+
+ // GetGroupChannel gets a group message channel.
+ GetGroupChannel(userIds []string) (*model.Channel, *model.AppError)
+
+ // UpdateChannel updates a channel.
+ UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError)
+
// CreatePost creates a post.
CreatePost(post *model.Post) (*model.Post, *model.AppError)
+
+ // DeletePost deletes a post.
+ DeletePost(postId string) *model.AppError
+
+ // GetPost gets a post.
+ GetPost(postId string) (*model.Post, *model.AppError)
+
+ // Update post updates a post.
+ UpdatePost(post *model.Post) (*model.Post, *model.AppError)
}