github.com/webdestroya/awsmocker@v0.2.6/types.go (about) 1 package awsmocker 2 3 import ( 4 "net" 5 "net/http" 6 ) 7 8 const ( 9 DefaultAccountId = "555555555555" 10 DefaultRegion = "us-east-1" 11 // DefaultInstanceId = "i-000deadbeef" 12 ) 13 14 type TestingT interface { 15 Setenv(key, value string) 16 TempDir() string 17 Cleanup(func()) 18 Fail() 19 Errorf(format string, args ...any) 20 Logf(format string, args ...any) 21 22 // These must be called from the test goroutine (which we will not be in) 23 // so do not use them 24 // FailNow() 25 // Fatalf(format string, args ...any) 26 } 27 28 type tHelper interface { 29 Helper() 30 } 31 32 type halfClosable interface { 33 net.Conn 34 CloseWrite() error 35 CloseRead() error 36 } 37 38 var _ halfClosable = (*net.TCPConn)(nil) 39 40 type ResponseEncoding int 41 42 const ( 43 // Default will try to determine encoding via the request headers 44 ResponseEncodingDefault ResponseEncoding = iota 45 ResponseEncodingJSON 46 ResponseEncodingXML 47 ResponseEncodingText 48 ) 49 50 type MockedRequestHandler = func(*ReceivedRequest) *http.Response