fixture

package
v0.0.0-...-dcedfe7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 29, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultipartImage

type MultipartImage struct {
	ImageFile     *os.File
	MultipartBody *bytes.Buffer
	ContentType   string
	// contains filtered or unexported fields
}

MultipartImage used for instantiating a test fixture for creating multipart file uploads containing an image

func NewMultipartImage

func NewMultipartImage(fileName string, contentType string) *MultipartImage

NewMultipartImage creates an image file for testing and creates a Multipart Form with this image file for testing

func (*MultipartImage) Close

func (m *MultipartImage) Close()

Close removes created file for test

func (*MultipartImage) GetFormFile

func (m *MultipartImage) GetFormFile() *multipart.FileHeader

GetFormFile extracts form file from multipart body

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL