MM-10702 Moving plugins to use hashicorp go-plugin. (#8978)
* Moving plugins to use hashicorp go-plugin. * Tweaks from feedback.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ecefa6cdd1
Коммит
1e5c432e10
@@ -7,7 +7,6 @@ package plugintest
|
||||
import http "net/http"
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
import model "github.com/mattermost/mattermost-server/model"
|
||||
import plugin "github.com/mattermost/mattermost-server/plugin"
|
||||
|
||||
// Hooks is an autogenerated mock type for the Hooks type
|
||||
type Hooks struct {
|
||||
@@ -39,6 +38,29 @@ func (_m *Hooks) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// Implemented provides a mock function with given fields:
|
||||
func (_m *Hooks) Implemented() ([]string, error) {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 []string
|
||||
if rf, ok := ret.Get(0).(func() []string); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func() error); ok {
|
||||
r1 = rf()
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// MessageHasBeenPosted provides a mock function with given fields: post
|
||||
func (_m *Hooks) MessageHasBeenPosted(post *model.Post) {
|
||||
_m.Called(post)
|
||||
@@ -95,13 +117,13 @@ func (_m *Hooks) MessageWillBeUpdated(newPost *model.Post, oldPost *model.Post)
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// OnActivate provides a mock function with given fields: _a0
|
||||
func (_m *Hooks) OnActivate(_a0 plugin.API) error {
|
||||
ret := _m.Called(_a0)
|
||||
// OnActivate provides a mock function with given fields:
|
||||
func (_m *Hooks) OnActivate() error {
|
||||
ret := _m.Called()
|
||||
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(plugin.API) error); ok {
|
||||
r0 = rf(_a0)
|
||||
if rf, ok := ret.Get(0).(func() error); ok {
|
||||
r0 = rf()
|
||||
} else {
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
@@ -137,7 +159,7 @@ func (_m *Hooks) OnDeactivate() error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// ServeHTTP provides a mock function with given fields: _a0, _a1
|
||||
func (_m *Hooks) ServeHTTP(_a0 http.ResponseWriter, _a1 *http.Request) {
|
||||
_m.Called(_a0, _a1)
|
||||
// ServeHTTP provides a mock function with given fields: w, r
|
||||
func (_m *Hooks) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
_m.Called(w, r)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user