protocol

package
v0.0.0-...-066b75c Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2014 License: MIT Imports: 7 Imported by: 42

Documentation

Overview

Package protocol implements ftp:// scheme plugin for http.Transport

github.com/jlaffaye/ftp library is used internally as FTP client implementation.

Limitations: only anonymous FTP servers, only file retrieval operations.

Internally connections to FTP servers are cached and re-used when possible.

Example:

transport := &http.Transport{}
transport.RegisterProtocol("ftp", &FTPRoundTripper{})
client := &http.Client{Transport: transport}
resp, err := client.Get("ftp://ftp.ru.debian.org/debian/README")

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FTPRoundTripper

type FTPRoundTripper struct {
	// contains filtered or unexported fields
}

FTPRoundTripper is an implementation of net/http.RoundTripper on top of FTP client

func (*FTPRoundTripper) RoundTrip

func (rt *FTPRoundTripper) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip parses incoming GET "HTTP" request and transforms it into commands to ftp client

Jump to

Keyboard shortcuts

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