Documentation ¶
Index ¶
- Constants
- Variables
- func NewExternalRecordDownloader(region string) *externalRecordDownloader
- func RegisterRecorder(next http.Handler, authService GatewayAuthService, region, bareDomain string) http.Handler
- func ShutdownRecorder()
- type GatewayAuthService
- type LazyOutput
- type PlayBackMockConf
- type ResponseWriter
- type StoredEvent
Constants ¶
View Source
const ( RequestExtension = ".request" ResponseExtension = ".response" ResponseHeaderExtension = ".response_headers" RequestBodyExtension = ".request_body" SimulationConfig = "simulation_config.json" RecordingRoot = "gateway/testdata/recordings" )
View Source
const EtagExtension = "etag"
Variables ¶
View Source
var PlaybackParams struct { IsPlayback bool CurrentUploadID []byte // used at playback to set the upload id in RecordingDir, PlaybackDir string }
Functions ¶
func NewExternalRecordDownloader ¶
func NewExternalRecordDownloader(region string) *externalRecordDownloader
func RegisterRecorder ¶
func ShutdownRecorder ¶
func ShutdownRecorder()
Types ¶
type GatewayAuthService ¶
type GatewayAuthService interface { GetCredentials(accessKey string) (*model.Credential, error) GetUserByID(userID int) (*model.User, error) Authorize(req *auth.AuthorizationRequest) (*auth.AuthorizationResponse, error) }
a limited service interface for the gateway, used by simulation playback
type LazyOutput ¶
func NewLazyOutput ¶
func NewLazyOutput(name string) *LazyOutput
func (*LazyOutput) Close ¶
func (l *LazyOutput) Close() error
type PlayBackMockConf ¶
type PlayBackMockConf struct { BareDomain string `json:"bare_domain"` AccessKeyID string `json:"access_key_id"` AccessSecretKey string `json:"access_secret_Key"` UserID int `json:"user_id"` Region string `json:"region"` }
func (*PlayBackMockConf) Authorize ¶
func (m *PlayBackMockConf) Authorize(req *auth.AuthorizationRequest) (*auth.AuthorizationResponse, error)
func (*PlayBackMockConf) GetCredentials ¶
func (m *PlayBackMockConf) GetCredentials(accessKey string) (*model.Credential, error)
func (*PlayBackMockConf) GetUserByID ¶
func (m *PlayBackMockConf) GetUserByID(userID int) (*model.User, error)
type ResponseWriter ¶
type ResponseWriter struct { OriginalWriter http.ResponseWriter ResponseLog *LazyOutput StatusCode int Headers http.Header UploadIDRegexp *regexp.Regexp // contains filtered or unexported fields }
func (*ResponseWriter) Header ¶
func (w *ResponseWriter) Header() http.Header
func (*ResponseWriter) SaveHeaders ¶
func (w *ResponseWriter) SaveHeaders(fName string)
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(statusCode int)
type StoredEvent ¶
Click to show internal directories.
Click to hide internal directories.