Update guide

This commit is contained in:
eyedeekay
2025-02-20 14:08:32 -05:00
parent 532ae9e5cc
commit f76c1be5bf
3 changed files with 39 additions and 0 deletions

View File

@ -76,6 +76,8 @@ jobs:
run: |
make clean
cp -v ../net_anon.go modules/graceful/net_anon.go
cp -v ../net_anon_unix.go modules/graceful/net_anon.go
cp -v ../net_anon_windows.go modules/graceful/net_anon.go
go mod tidy
make build
env:

23
net_anon_unix.go Normal file
View File

@ -0,0 +1,23 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
//go:build !windows
package graceful
import (
"fmt"
"net"
)
func GetListenerUnix(network string, addr net.Addr) (net.Listener, error) {
switch addr.(type) {
case *net.UnixAddr:
return net.ListenUnix(network, addr.(*net.UnixAddr))
default:
return nil, fmt.Errorf("unknown address type %T", addr)
}
}

14
net_anon_windows.go Normal file
View File

@ -0,0 +1,14 @@
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
// This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
//go:build windows
package graceful
import "net"
func GetListenerUnix(network string, addr net.Addr) (net.Listener, error) {
return nil, nil
}