mirror of https://github.com/hashicorp/terraform
parent
d0e5c3cc7b
commit
a2ce38ce12
@ -1,50 +0,0 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package mock_tfplugin5
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"io"
|
||||
|
||||
proto "github.com/hashicorp/terraform/internal/tfplugin5"
|
||||
metadata "google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
var _ proto.Provider_InvokeActionClient = (*MockInvokeProtoClient)(nil)
|
||||
|
||||
type MockInvokeProtoClient struct {
|
||||
Events []*proto.InvokeAction_Event
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Recv() (*proto.InvokeAction_Event, error) {
|
||||
if len(m.Events) == 0 {
|
||||
return nil, io.EOF
|
||||
}
|
||||
event := m.Events[0]
|
||||
m.Events = m.Events[1:]
|
||||
return event, nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) CloseSend() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Context() context.Context {
|
||||
return context.TODO()
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Header() (metadata.MD, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) RecvMsg(k any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) SendMsg(k any) error {
|
||||
return nil
|
||||
}
|
||||
func (m *MockInvokeProtoClient) Trailer() metadata.MD {
|
||||
return nil
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin5 ProviderClient,ProvisionerClient,Provisioner_ProvisionResourceClient,Provisioner_ProvisionResourceServer
|
||||
//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin5 ProviderClient,ProvisionerClient,Provisioner_ProvisionResourceClient,Provisioner_ProvisionResourceServer,Provider_InvokeActionClient
|
||||
|
||||
package mock_tfplugin5
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package mock_tfplugin6
|
||||
|
||||
import (
|
||||
context "context"
|
||||
"io"
|
||||
|
||||
proto "github.com/hashicorp/terraform/internal/tfplugin6"
|
||||
metadata "google.golang.org/grpc/metadata"
|
||||
)
|
||||
|
||||
var _ proto.Provider_InvokeActionClient = (*MockInvokeProtoClient)(nil)
|
||||
|
||||
type MockInvokeProtoClient struct {
|
||||
Events []*proto.InvokeAction_Event
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Recv() (*proto.InvokeAction_Event, error) {
|
||||
if len(m.Events) == 0 {
|
||||
return nil, io.EOF
|
||||
}
|
||||
event := m.Events[0]
|
||||
m.Events = m.Events[1:]
|
||||
return event, nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) CloseSend() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Context() context.Context {
|
||||
return context.TODO()
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) Header() (metadata.MD, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) RecvMsg(k any) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *MockInvokeProtoClient) SendMsg(k any) error {
|
||||
return nil
|
||||
}
|
||||
func (m *MockInvokeProtoClient) Trailer() metadata.MD {
|
||||
return nil
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin6 ProviderClient
|
||||
//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin6 ProviderClient,Provider_InvokeActionClient
|
||||
|
||||
package mock_tfplugin6
|
||||
|
||||
Loading…
Reference in new issue