Skip to content

Commit 91deba2

Browse files
sriniociMaxrovr
authored andcommitted
Exempted Added CRUD changes for SIGINT propagation
1 parent 63475c6 commit 91deba2

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

internal/tfresource/crud_helpers.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"encoding/hex"
1212
"encoding/json"
1313
"fmt"
14+
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1415
"io"
1516
"io/ioutil"
1617
"log"

internal/tfresource/crud_interface.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package tfresource
55

66
import (
7+
"context"
78
"sync"
89
"time"
910
)
@@ -115,3 +116,31 @@ type StatefullyDeletedResource interface {
115116
type SynchronizedResource interface {
116117
GetMutex() *sync.Mutex
117118
}
119+
120+
// SIGINT Changes
121+
type ResourceCreatorWithContext interface {
122+
ResourceDataWriter
123+
// ID identifies the resource, or a work request to Create the resource.
124+
ID() string
125+
CreateWithContext(ctx context.Context) error
126+
}
127+
128+
type ResourceReaderWithContext interface {
129+
ResourceDataWriter
130+
ResourceFetcherWithContext
131+
}
132+
type ResourceUpdaterWithContext interface {
133+
ResourceDataWriter
134+
UpdateWithContext(ctx context.Context) error
135+
}
136+
type ResourceDeleterWithContext interface {
137+
ResourceVoider
138+
// ID identifies the resource, or a work request to Create the resource.
139+
ID() string
140+
DeleteWithContext(ctx context.Context) error
141+
}
142+
type ResourceFetcherWithContext interface {
143+
// Get should Update the s.Resource, and is used by ReadResource() to populate s.D
144+
// Get() may expect s.D.Id() to be set, but not s.Resource, or anything else in s.D
145+
GetWithContext(ctx context.Context) error
146+
}

0 commit comments

Comments
 (0)