Skip to content

Add ability to skip certain interactions from getting saved to disk #80

@sergiught

Description

@sergiught

Describe the problem you'd like to have solved

I'd like to have a way to specify which kind of Interaction to skip from being recorded on disk inside a cassette. This would be useful for example if I don't want the cassette spammed with 429s.

Describe the ideal solution

Perhaps something like:

recorder.AddHook(
	func(i *cassette.Interaction) error {
		if i.Response.Code == http.StatusTooManyRequests {
			i.Skip()
			return nil
		}
		return nil
	},
	recorder.BeforeSaveHook,
)

Alternatives and current workarounds

Current workaround would be to manually remove them from the cassette file.

Additional context

Thanks a lot for maintaining this! It's a great project. 👍🏻

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions