chore: Restructure files.
This commit is contained in:
parent
559588f726
commit
d25da9091e
93 changed files with 38 additions and 26 deletions
18
backend/backendlauncher/backendlauncher.go
Normal file
18
backend/backendlauncher/backendlauncher.go
Normal file
|
@ -0,0 +1,18 @@
|
|||
package backendlauncher
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand/v2"
|
||||
"net"
|
||||
)
|
||||
|
||||
func GetUnixSocket(folder string) (string, net.Listener, error) {
|
||||
socketPath := fmt.Sprintf("%s/sock-%d.sock", folder, rand.Uint())
|
||||
listener, err := net.Listen("unix", socketPath)
|
||||
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
return socketPath, listener, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue