Documentation ¶
Index ¶
- Constants
- Variables
- func CheckBlocked(r *http.Request) bool
- func DIG(domain, remote, clientIP string) ([]dns.RR, error)
- func GetNetClass(ip net.IP) string
- func GetUploadPage(title, path string) string
- func IP2Num(ipstr string) uint32
- func IPv62Num(ipstr string) (uint64, uint64)
- func IsIPv6(ip string) bool
- func Num2IP(ipnum uint32) string
- func Num2IPv6(network, intf uint64) string
- func PrintMapValue(msg string, str []string) string
- func SplitTimestamp(cookie string) int64
- type CookieManager
- type FakeHandler
- type FakeResponse
- type Stat
- type StatType
- type TcpProxy
- type UploaderService
Constants ¶
View Source
const BlockHTML = `` /* 774-byte string literal not displayed */
View Source
const Header = `` /* 946-byte string literal not displayed */
View Source
const Tail = `` /* 499-byte string literal not displayed */
Variables ¶
View Source
var ErrBadIP = errors.New("bad ip value")
ErrBadIP indicates ip is not valid
View Source
var ErrBadPort = errors.New("bad port value")
ErrBadPort indicates port is not valid or not authorized
Functions ¶
func CheckBlocked ¶ added in v1.0.7
func GetUploadPage ¶ added in v1.0.8
func PrintMapValue ¶
func SplitTimestamp ¶ added in v1.0.17
Types ¶
type CookieManager ¶ added in v1.0.7
func NewCookieManager ¶ added in v1.0.7
func NewCookieManager(pass, prefix string, exp int64) *CookieManager
func (*CookieManager) CheckCookie ¶ added in v1.0.7
func (cm *CookieManager) CheckCookie(r *http.Request, key, cookieKey string) string
func (*CookieManager) ClrCookie ¶ added in v1.0.7
func (cm *CookieManager) ClrCookie(w http.ResponseWriter, key string)
func (*CookieManager) SetCookie ¶ added in v1.0.7
func (cm *CookieManager) SetCookie(w http.ResponseWriter, key, cookieKey string)
type FakeHandler ¶
func (*FakeHandler) IsUsingFakeResponse ¶
func (h *FakeHandler) IsUsingFakeResponse(uri string) bool
func (*FakeHandler) ServeHTTP ¶
func (h *FakeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FakeResponse ¶
type FakeResponse struct {
// contains filtered or unexported fields
}
func (*FakeResponse) Header ¶
func (f *FakeResponse) Header() http.Header
func (*FakeResponse) WriteHeader ¶
func (f *FakeResponse) WriteHeader(statusCode int)
type Stat ¶
type Stat struct { TotalInb int64 TotalOutb int64 Inb int64 Outb int64 Ts time.Time Lock sync.Mutex }
Stat gets data every 2 minutes
type TcpProxy ¶
TcpProxy stores ip and port information
func (*TcpProxy) LoopCopy ¶
func (p *TcpProxy) LoopCopy(dst io.WriteCloser, src io.ReadCloser, statType StatType)
LoopCopy copies data until error occur
func (*TcpProxy) StatCounter ¶
func (p *TcpProxy) StatCounter()
StatCounter reset stat every 2 minutes
type UploaderService ¶ added in v1.0.7
type UploaderService struct { MaxSize int64 MaxMem int64 Curr int64 BasePath string BaseURL string JumpBackURL string NameLen int Expire time.Duration Lock sync.Mutex Map map[string]time.Time }
func NewUploadService ¶ added in v1.0.7
func (*UploaderService) Handler ¶ added in v1.0.7
func (u *UploaderService) Handler(w http.ResponseWriter, r *http.Request)
Handler return page if get and write file into disk if post
func (*UploaderService) Patrol ¶ added in v1.0.18
func (u *UploaderService) Patrol()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.