file

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: May 16, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package file implements a solution for handling files coming from a request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFilePath

func MakeFilePath(workingDir string, ext string) string

MakeFilePath is a simple helper which generates a random file name and associates it with the considered directory to make a path.

Types

type File

type File struct {
	// Extension is the extension of the file.
	Extension string
	// Path is the file path.
	Path string
}

File represents a file which has been created from a request.

func NewFile

func NewFile(workingDir string, r io.Reader, fileName string) (*File, error)

NewFile creates a file in the considered directory. Returns a *File instance or an error if something bad happened.

Jump to

Keyboard shortcuts

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