mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
Link refactor (#941)
* Link refactoring * More refactoring * More tweaking * Cleaner shutdowns, UNIX socket support, more tweaks * Actorise links, remove mutex * SOCKS support
This commit is contained in:
parent
414aaf6eb9
commit
5ef61faeff
18 changed files with 738 additions and 698 deletions
|
@ -175,6 +175,9 @@ func (a *AdminSocket) IsStarted() bool {
|
|||
|
||||
// Stop will stop the admin API and close the socket.
|
||||
func (a *AdminSocket) Stop() error {
|
||||
if a == nil {
|
||||
return nil
|
||||
}
|
||||
if a.listener != nil {
|
||||
select {
|
||||
case <-a.done:
|
||||
|
@ -321,6 +324,8 @@ type DataUnit uint64
|
|||
|
||||
func (d DataUnit) String() string {
|
||||
switch {
|
||||
case d > 1024*1024*1024*1024:
|
||||
return fmt.Sprintf("%2.ftb", float64(d)/1024/1024/1024/1024)
|
||||
case d > 1024*1024*1024:
|
||||
return fmt.Sprintf("%2.fgb", float64(d)/1024/1024/1024)
|
||||
case d > 1024*1024:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue