-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
50 lines (40 loc) · 936 Bytes
/
types.go
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
package awsmocker
import (
"net"
"net/http"
)
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)
}
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