# README

transferstats Package

This provides a net.Conn interface implementation that can be put in a chain of connections and used to collect transfer statistics for the network traffic passing through it.

Total bytes transferred is recorded, as well as per-hostname bytes transferred stats for HTTP and HTTPS traffic (as long as the HTTPS traffic contains SNI information). Which hostnames are recorded is specified by a set of regular expressions.

(TODO: More info.)

# Functions

MakeRegexps takes the raw string-map form of the regex-replace pairs returned by the server handshake and turns them into a usable object.
NewConn creates a Conn.
PutBackStatsForServer re-adds a set of server stats to the collection.
ReportRecentBytesTransferredForServer returns bytes sent and received since the last call to ReportRecentBytesTransferredForServer.
TakeOutStatsForServer borrows the AccumulatedStats for the specified server.

# Structs

AccumulatedStats holds the Psiphon Server API status request data for a given server.
Conn is to be used as an intermediate link in a chain of net.Conn objects.

# Type aliases

Regexps holds the regular expressions and replacement strings used for transforming URLs and hostnames into a stats-appropriate forms.