mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
The server module named github.com/hanzoai/team/server/v8 — a path that resolves to the retired workspace's repository, not this one — while server/public still published github.com/mattermost/mattermost/server/public. Both are github.com/hanzoteam/server/... now, which is where this code actually lives. That second half is what made the binary unbootable. Upstream's public path stayed claimed by upstream, mattermost-plugin-ai imported it, and the build linked public/model twice; public/plugin's gob.Register then ran twice under one name and panicked at init, before main. Reverting the rename traded the brand for a working binary. Rebranding the plugin alongside it needs no such trade: the agents fork is github.com/hanzoteam/agents/v2 against our public module, so no module named mattermost/mattermost is in the graph at all. Measured: `go list -deps ./cmd/mattermost` names exactly one public/model, and it is ours.
115 lines
3.9 KiB
Go
115 lines
3.9 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
// Hand-written *WithRPCErr mock methods for the three hooks excluded from the code generator.
|
|
// The auto-generated hooks.go (regenerated by `make plugin-mocks`) covers the base Hooks interface;
|
|
// this file adds the extra *WithRPCErr companions so *Hooks satisfies plugin.HooksWithRPCErr.
|
|
// This file is not overwritten by `make plugin-mocks` because mockery writes only hooks.go for the
|
|
// Hooks interface (filename: "{{.InterfaceNameLower}}.go" in .mockery.yaml).
|
|
|
|
package plugintest
|
|
|
|
import (
|
|
model "github.com/hanzoteam/server/server/public/model"
|
|
plugin "github.com/hanzoteam/server/server/public/plugin"
|
|
)
|
|
|
|
// MessageWillBePostedWithRPCErr provides a mock function with given fields: c, post
|
|
func (_m *Hooks) MessageWillBePostedWithRPCErr(c *plugin.Context, post *model.Post) (*model.Post, string, error) {
|
|
ret := _m.Called(c, post)
|
|
|
|
var r0 *model.Post
|
|
var r1 string
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) (*model.Post, string, error)); ok {
|
|
return rf(c, post)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post) *model.Post); ok {
|
|
r0 = rf(c, post)
|
|
} else if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post) string); ok {
|
|
r1 = rf(c, post)
|
|
} else {
|
|
r1 = ret.Get(1).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(*plugin.Context, *model.Post) error); ok {
|
|
r2 = rf(c, post)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// MessageWillBeUpdatedWithRPCErr provides a mock function with given fields: c, newPost, oldPost
|
|
func (_m *Hooks) MessageWillBeUpdatedWithRPCErr(c *plugin.Context, newPost *model.Post, oldPost *model.Post) (*model.Post, string, error) {
|
|
ret := _m.Called(c, newPost, oldPost)
|
|
|
|
var r0 *model.Post
|
|
var r1 string
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) (*model.Post, string, error)); ok {
|
|
return rf(c, newPost, oldPost)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.Post, *model.Post) *model.Post); ok {
|
|
r0 = rf(c, newPost, oldPost)
|
|
} else if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.Post)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.Post, *model.Post) string); ok {
|
|
r1 = rf(c, newPost, oldPost)
|
|
} else {
|
|
r1 = ret.Get(1).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(*plugin.Context, *model.Post, *model.Post) error); ok {
|
|
r2 = rf(c, newPost, oldPost)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// ChannelMemberWillBeAddedWithRPCErr provides a mock function with given fields: c, channelMember
|
|
func (_m *Hooks) ChannelMemberWillBeAddedWithRPCErr(c *plugin.Context, channelMember *model.ChannelMember) (*model.ChannelMember, string, error) {
|
|
ret := _m.Called(c, channelMember)
|
|
|
|
var r0 *model.ChannelMember
|
|
var r1 string
|
|
var r2 error
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.ChannelMember) (*model.ChannelMember, string, error)); ok {
|
|
return rf(c, channelMember)
|
|
}
|
|
if rf, ok := ret.Get(0).(func(*plugin.Context, *model.ChannelMember) *model.ChannelMember); ok {
|
|
r0 = rf(c, channelMember)
|
|
} else if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(*model.ChannelMember)
|
|
}
|
|
|
|
if rf, ok := ret.Get(1).(func(*plugin.Context, *model.ChannelMember) string); ok {
|
|
r1 = rf(c, channelMember)
|
|
} else {
|
|
r1 = ret.Get(1).(string)
|
|
}
|
|
|
|
if rf, ok := ret.Get(2).(func(*plugin.Context, *model.ChannelMember) error); ok {
|
|
r2 = rf(c, channelMember)
|
|
} else {
|
|
r2 = ret.Error(2)
|
|
}
|
|
|
|
return r0, r1, r2
|
|
}
|
|
|
|
// Note: plugintest.Hooks is a mock for the base Hooks interface only. The auto-generated
|
|
// hooks.go does not include *WithRPCErr methods, so *Hooks cannot satisfy HooksWithRPCErr
|
|
// in full. The production compile-time assertions for HooksWithRPCErr live in client_rpc.go
|
|
// (for *hooksRPCClient and *hooksTimerLayer). Tests that need a HooksWithRPCErr double
|
|
// should embed *Hooks and add the needed *WithRPCErr stubs directly.
|