1 Star 0 Fork 0

ryancartoon / sensu-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mock_hook_client.go 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
package testing
import (
"github.com/sensu/sensu-go/cli/client"
"github.com/sensu/sensu-go/types"
corev2 "github.com/sensu/sensu-go/api/core/v2"
)
// CreateHook for use with mock lib
func (c *MockClient) CreateHook(hook *types.HookConfig) error {
args := c.Called(hook)
return args.Error(0)
}
// UpdateHook for use with mock lib
func (c *MockClient) UpdateHook(hook *types.HookConfig) error {
args := c.Called(hook)
return args.Error(0)
}
// DeleteHook for use with mock lib
func (c *MockClient) DeleteHook(namespace, name string) error {
args := c.Called(namespace, name)
return args.Error(0)
}
// FetchHook for use with mock lib
func (c *MockClient) FetchHook(name string) (*types.HookConfig, error) {
args := c.Called(name)
return args.Get(0).(*types.HookConfig), args.Error(1)
}
// ListHooks for use with mock lib
func (c *MockClient) ListHooks(namespace string, options *client.ListOptions) ([]corev2.HookConfig, error) {
args := c.Called(namespace, options)
return args.Get(0).([]corev2.HookConfig), args.Error(1)
}
1
https://gitee.com/ryancartoon/sensu-go.git
git@gitee.com:ryancartoon/sensu-go.git
ryancartoon
sensu-go
sensu-go
v5.10.1

搜索帮助

53164aa7 5694891 3bd8fe86 5694891