upload

package
v8.8.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const RewrittenFieldsHeader = "Gitlab-Workhorse-Multipart-Fields"

Variables

This section is empty.

Functions

func Accelerate added in v1.2.0

func Accelerate(rails filestore.PreAuthorizer, h http.Handler) http.Handler

func HandleFileUploads added in v0.6.1

func HandleFileUploads(w http.ResponseWriter, r *http.Request, h http.Handler, preauth *api.Response, filter MultipartFormProcessor)

Types

type MultipartClaims added in v1.2.0

type MultipartClaims struct {
	RewrittenFields map[string]string `json:"rewritten_fields"`
	jwt.StandardClaims
}

type MultipartFormProcessor added in v0.6.1

type MultipartFormProcessor interface {
	ProcessFile(ctx context.Context, formName string, file *filestore.FileHandler, writer *multipart.Writer) error
	ProcessField(ctx context.Context, formName string, writer *multipart.Writer) error
	Finalize(ctx context.Context) error
	Name() string
}

These methods are allowed to have thread-unsafe implementations.

type SkipRailsAuthorizer

type SkipRailsAuthorizer struct {
	// TempPath is the temporary path for a local only upload
	TempPath string
}

SkipRailsAuthorizer implements a fake PreAuthorizer that do not calls rails API and authorize each call as a local only upload to TempPath

func (*SkipRailsAuthorizer) PreAuthorizeHandler

func (l *SkipRailsAuthorizer) PreAuthorizeHandler(next api.HandleFunc, _ string) http.Handler

PreAuthorizeHandler implements PreAuthorizer. It always grant the upload. The fake API response contains only TempPath

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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