From 908a682fcf3bbc48db75099f636d627616757b24 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Fri, 20 Jul 2018 12:03:08 -0400 Subject: make GetChannelByName take teamId first (#9134) * make GetChannelByName take teamId first I think it is more natural to accept `teamId`, then `channelName`, given the pattern followed by other Plugin API methods and even the SQL Store itself. The App layer seems unusual in accepting `channelName` first. This also re-generates the mocks fixing the parameter order for the recently added `UserStatus` APIs. * add GetChannelByNameForTeamName --- plugin/api.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugin/api.go') diff --git a/plugin/api.go b/plugin/api.go index 70a3e7ab5..6d4976c4f 100644 --- a/plugin/api.go +++ b/plugin/api.go @@ -101,14 +101,17 @@ type API interface { // DeleteChannel deletes a channel. DeleteChannel(channelId string) *model.AppError - // GetChannels gets a list of all channels. + // GetPublicChannelsForTeam gets a list of all channels. GetPublicChannelsForTeam(teamId string, offset, limit int) (*model.ChannelList, *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) + // GetChannelByName gets a channel by its name, given a team id. + GetChannelByName(teamId, name string) (*model.Channel, *model.AppError) + + // GetChannelByNameForTeamName gets a channel by its name, given a team name. + GetChannelByNameForTeamName(teamName, channelName string) (*model.Channel, *model.AppError) // GetDirectChannel gets a direct message channel. GetDirectChannel(userId1, userId2 string) (*model.Channel, *model.AppError) @@ -149,13 +152,13 @@ type API interface { // UpdatePost updates a post. UpdatePost(post *model.Post) (*model.Post, *model.AppError) - // Set will store a key-value pair, unique per plugin. + // KVSet will store a key-value pair, unique per plugin. KVSet(key string, value []byte) *model.AppError - // Get will retrieve a value based on the key. Returns nil for non-existent keys. + // KVGet will retrieve a value based on the key. Returns nil for non-existent keys. KVGet(key string) ([]byte, *model.AppError) - // Delete will remove a key-value pair. Returns nil for non-existent keys. + // KVDelete will remove a key-value pair. Returns nil for non-existent keys. KVDelete(key string) *model.AppError // PublishWebSocketEvent sends an event to WebSocket connections. -- cgit v1.2.3-1-g7c22