-
Notifications
You must be signed in to change notification settings - Fork 319
add FilesWithNames() to activation #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Thank you for contributing! Would you mind explaining your usecase ? |
sure, my program uses socket units with both Listen and ListenDatagram settings, some of which may be used to create TLS listeners, and some of which may not. The existing *WithNames functions assume that all the sockets use the same protocol, and that either all or none will be used to create TLS listeners. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I see, this is just a wrapper on top of Files
which converts the returned *os.File
slice into a map, where the key is file name and the value is a slice of *os.File
corresponding to this name.
Such functionality, if needed, can easily be recreated in software that uses this package and activation.Files
, in just a few lines of code. Unless such usage is a very common case, I can hardly see why we should put this method into this repo.
right, these are those few lines of code. there are already funcs in activation that create TCP listeners with TLS configurations for each stream fd and map names to them, which is a much more special case than what |
I'd like to upstream the function here https://github.com/MayCXC/caddy-systemd-socket-activation/blob/master/networks.go#L25
which is like the
*WithNames
funcs herego-systemd/activation/listeners.go
Line 42 in 7d375ec