Documentation ¶
Overview ¶
- Copyright (c) 2019. Abstrium SAS <team (at) pydio.com>
- This file is part of Pydio Cells. *
- Pydio Cells is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio Cells is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio Cells. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com>.
Package net provides tools for reading IPs, available Ports, extending HTTP requests, etc.
- Copyright (c) 2019. Abstrium SAS <team (at) pydio.com>
- This file is part of Pydio Cells. *
- Pydio Cells is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- Pydio Cells is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details. *
- You should have received a copy of the GNU Affero General Public License
- along with Pydio Cells. If not, see <http://www.gnu.org/licenses/>. *
- The latest code can be found at <https://pydio.com>.
Index ¶
- Variables
- func BodyWithProgressMonitor(resp *http.Response, progress chan float64, done chan bool) io.Reader
- func DetectHasPrivateIP() (bool, string, error)
- func GetAvailableIPs() (ips []net.IP, e error)
- func GetAvailablePort() int
- func GetExternalIP() (net.IP, error)
- func GetOutboundIP() (net.IP, error)
- func GetTimeFromNtp() (time.Time, error)
- func PeerAddressIsLocal(address string) bool
- type ProgressMonitor
Constants ¶
This section is empty.
Variables ¶
var (
DefaultAdvertiseAddress string
)
Functions ¶
func BodyWithProgressMonitor ¶
BodyWithProgressMonitor creates a ProgressMonitor directly from an http.Response
func DetectHasPrivateIP ¶
func GetAvailableIPs ¶
GetExternalIP retrieves the preferred outbound ip of this machine by scanning the network interfaces of this (virtual) machine
func GetAvailablePort ¶
func GetAvailablePort() int
GetAvailablePort finds an available TCP port on which to listen to.
func GetExternalIP ¶
GetExternalIP retrieves the preferred outbound ip of this machine by scanning the network interfaces of this (virtual) machine
func GetOutboundIP ¶
GetOutboundIP restrieves the preferred outbound ip of this machine by simply connecting to a well known ip of the internet.
func GetTimeFromNtp ¶
func PeerAddressIsLocal ¶
PeerAddressIsLocal compares and address (can be an IP or Hostname) to the current server values
Types ¶
type ProgressMonitor ¶
type ProgressMonitor struct { SizeChan chan uint64 // contains filtered or unexported fields }
ProgressMonitor provides a TeeReader to wrap a reader and send a progress inside a dedicated channel
func NewProgressMonitor ¶
func NewProgressMonitor(expected uint64, progress chan float64, done chan bool) *ProgressMonitor
NewProgressMonitor initialize a ProgressMonitor with the channels