本文整理汇总了Golang中github.com/mattermost/platform/model.Client.Must方法的典型用法代码示例。如果您正苦于以下问题:Golang Client.Must方法的具体用法?Golang Client.Must怎么用?Golang Client.Must使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/mattermost/platform/model.Client
的用法示例。
在下文中一共展示了Client.Must方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CreatePost
func (me *TestHelper) CreatePost(client *model.Client, channel *model.Channel) *model.Post {
id := model.NewId()
post := &model.Post{
ChannelId: channel.Id,
Message: "message_" + id,
}
utils.DisableDebugLogForTest()
r := client.Must(client.CreatePost(post)).Data.(*model.Post)
utils.EnableDebugLogForTest()
return r
}
示例2: CreateTeam
func (me *TestHelper) CreateTeam(client *model.Client) *model.Team {
id := model.NewId()
team := &model.Team{
DisplayName: "dn_" + id,
Name: "name" + id,
Email: "success+" + id + "@simulator.amazonses.com",
Type: model.TEAM_OPEN,
}
utils.DisableDebugLogForTest()
r := client.Must(client.CreateTeam(team)).Data.(*model.Team)
utils.EnableDebugLogForTest()
return r
}
示例3: createChannel
func (me *TestHelper) createChannel(client *model.Client, team *model.Team, channelType string) *model.Channel {
id := model.NewId()
channel := &model.Channel{
DisplayName: "dn_" + id,
Name: "name_" + id,
Type: channelType,
TeamId: team.Id,
}
utils.DisableDebugLogForTest()
r := client.Must(client.CreateChannel(channel)).Data.(*model.Channel)
utils.EnableDebugLogForTest()
return r
}
示例4: CreateUser
func (me *TestHelper) CreateUser(client *model.Client) *model.User {
id := model.NewId()
user := &model.User{
Email: "success+" + id + "@simulator.amazonses.com",
Username: "un_" + id,
Nickname: "nn_" + id,
Password: "Password1",
}
utils.DisableDebugLogForTest()
ruser := client.Must(client.CreateUser(user, "")).Data.(*model.User)
ruser.Password = "Password1"
store.Must(Srv.Store.User().VerifyEmail(ruser.Id))
utils.EnableDebugLogForTest()
return ruser
}