/
left76
/
ccli8
Обзор
Документация
Войти
/
left76
/
ccli8
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
cli/command/task/client_test.go
29 строк
867 B
Kir Kolyshkin
Switch from x/net/context to context
12 май 2018, 02:49
12 май 2018, 02:49
6f8070d
Код
Авторство
О чём код?
package task import ( "context" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/swarm" "github.com/docker/docker/client" ) type fakeClient struct { client.APIClient nodeInspectWithRaw func(ref string) (swarm.Node, []byte, error) serviceInspectWithRaw func(ref string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) } func (cli *fakeClient) NodeInspectWithRaw(ctx context.Context, ref string) (swarm.Node, []byte, error) { if cli.nodeInspectWithRaw != nil { return cli.nodeInspectWithRaw(ref) } return swarm.Node{}, nil, nil } func (cli *fakeClient) ServiceInspectWithRaw(ctx context.Context, ref string, options types.ServiceInspectOptions) (swarm.Service, []byte, error) { if cli.serviceInspectWithRaw != nil { return cli.serviceInspectWithRaw(ref, options) } return swarm.Service{}, nil, nil }