-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
63 lines (50 loc) · 1.26 KB
/
types.go
File metadata and controls
63 lines (50 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package awsmocker
import (
"net"
"net/http"
"testing"
"github.com/aws/aws-sdk-go-v2/config"
)
const (
DefaultAccountId = "555555555555"
DefaultRegion = "us-east-1"
// DefaultInstanceId = "i-000deadbeef"
)
type TestingT interface {
Setenv(key, value string)
TempDir() string
Cleanup(func())
Fail()
Errorf(format string, args ...any)
Logf(format string, args ...any)
// These must be called from the test goroutine (which we will not be in)
// so do not use them
// FailNow()
// Fatalf(format string, args ...any)
}
var (
_ TestingT = (*testing.T)(nil)
_ TestingT = (*testing.B)(nil)
)
type tHelper interface {
Helper()
}
type halfClosable interface {
net.Conn
CloseWrite() error
CloseRead() error
}
var _ halfClosable = (*net.TCPConn)(nil)
type ResponseEncoding int
const (
// Default will try to determine encoding via the request headers
ResponseEncodingDefault ResponseEncoding = iota
ResponseEncodingJSON
ResponseEncodingXML
ResponseEncodingText
)
type MockedRequestHandler = func(*ReceivedRequest) *http.Response
// Come on Amazon...
// Can't use {config.LoadOptionsFunc} because that is not a param for LoadDefaultConfig
// Why would you define the type and then not even use it...
type AwsLoadOptionsFunc = func(*config.LoadOptions) error