Documentation ¶
Index ¶
- Constants
- func NewExternalRecordDownloader(region string) *externalRecordDownloader
- func RegisterRecorder(next http.Handler, authService GatewayAuthService, region string, ...) http.Handler
- func ShutdownRecorder()
- type GatewayAuthService
- type LazyOutput
- type PlayBackMockConf
- func (m *PlayBackMockConf) Authorize(_ context.Context, req *auth.AuthorizationRequest) (*auth.AuthorizationResponse, error)
- func (m *PlayBackMockConf) GetCredentials(_ context.Context, accessKey string) (*model.Credential, error)
- func (m *PlayBackMockConf) GetUserByID(_ context.Context, userID int) (*model.User, error)
- 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 ¶
This section is empty.
Functions ¶
func NewExternalRecordDownloader ¶
func NewExternalRecordDownloader(region string) *externalRecordDownloader
func RegisterRecorder ¶
func ShutdownRecorder ¶
func ShutdownRecorder()
Types ¶
type GatewayAuthService ¶
type GatewayAuthService interface { GetCredentials(ctx context.Context, accessKey string) (*model.Credential, error) GetUserByID(ctx context.Context, userID int) (*model.User, error) Authorize(ctx context.Context, 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"` SecretAccessKey string `json:"access_secret_key"` UserID int `json:"user_id"` Region string `json:"region"` }
func (*PlayBackMockConf) Authorize ¶
func (m *PlayBackMockConf) Authorize(_ context.Context, req *auth.AuthorizationRequest) (*auth.AuthorizationResponse, error)
func (*PlayBackMockConf) GetCredentials ¶
func (m *PlayBackMockConf) GetCredentials(_ context.Context, accessKey string) (*model.Credential, error)
func (*PlayBackMockConf) GetUserByID ¶
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.