Update dependencies

This commit is contained in:
bluepython508
2024-11-01 17:33:34 +00:00
parent 033ac0b400
commit 5cdfab398d
3596 changed files with 1033483 additions and 259 deletions

9
vendor/github.com/mdlayher/sdnotify/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,9 @@
# MIT License
Copyright (C) 2020-2022 Matt Layher
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

4
vendor/github.com/mdlayher/sdnotify/README.md generated vendored Normal file
View File

@@ -0,0 +1,4 @@
# sdnotify [![Test Status](https://github.com/mdlayher/sdnotify/workflows/Test/badge.svg)](https://github.com/mdlayher/sdnotify/actions) [![Go Reference](https://pkg.go.dev/badge/github.com/mdlayher/sdnotify.svg)](https://pkg.go.dev/github.com/mdlayher/sdnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/mdlayher/sdnotify)](https://goreportcard.com/report/github.com/mdlayher/sdnotify)
Package `sdnotify` implements systemd readiness notifications as described in
https://www.freedesktop.org/software/systemd/man/sd_notify.html. MIT Licensed.

96
vendor/github.com/mdlayher/sdnotify/sdnotify.go generated vendored Normal file
View File

@@ -0,0 +1,96 @@
// Package sdnotify implements systemd readiness notifications as described in
// https://www.freedesktop.org/software/systemd/man/sd_notify.html.
package sdnotify
import (
"fmt"
"io"
"net"
"os"
"strings"
)
// Socket is the predefined systemd notification socket environment variable.
const Socket = "NOTIFY_SOCKET"
// Common notification values. For a description of each, see:
// https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description.
const (
Ready = "READY=1"
Reloading = "RELOADING=1"
Stopping = "STOPPING=1"
)
// Statusf creates a formatted STATUS notification with the input format string
// and values.
func Statusf(format string, v ...interface{}) string {
return fmt.Sprintf("STATUS=%s", fmt.Sprintf(format, v...))
}
// A Notifier can notify systemd of service status and readiness. Any methods
// called on a nil Notifier will result in a no-op, allowing graceful
// functionality degradation when a Go program is not running under systemd
// supervision.
type Notifier struct{ wc io.WriteCloser }
// New creates a Notifier which sends notifications to the UNIX socket specified
// by the NOTIFY_SOCKET environment variable. See Open for more details.
func New() (*Notifier, error) {
s := os.Getenv(Socket)
if s == "" {
// Don't bother stat'ing an empty socket, just return now.
return nil, os.ErrNotExist
}
return Open(s)
}
// Open creates a Notifier which sends notifications to the UNIX socket
// specified by sock.
//
// If sock does not exist or is unset (meaning the service is not running under
// systemd supervision, or is not using systemd unit Type=notify), Open will
// return an error which can be checked with 'errors.Is(err, os.ErrNotExist)'.
// Calling any of the resulting nil Notifier's methods will result in a no-op.
func Open(sock string) (*Notifier, error) {
// Don't stat Linux abstract namespace sockets, as would be created with a
// net.ListenPacket with no path.
if !strings.HasPrefix(sock, "@") {
if _, err := os.Stat(sock); err != nil {
return nil, fmt.Errorf("failed to stat notify socket: %w", err)
}
}
c, err := net.Dial("unixgram", sock)
if err != nil {
return nil, err
}
return &Notifier{wc: c}, nil
}
// Notify sends zero or more notifications to systemd. See the package constants
// for a list of common notifications or use the Statusf function to create a
// STATUS notification.
//
// For advanced use cases, see:
// https://www.freedesktop.org/software/systemd/man/sd_notify.html#Description.
//
// If n is nil or no strings are specified, Notify is a no-op.
func (n *Notifier) Notify(s ...string) error {
if n == nil || len(s) == 0 {
return nil
}
_, err := io.WriteString(n.wc, strings.Join(s, "\n"))
return err
}
// Close closes the Notifier's socket. If n is nil, Close is a no-op.
func (n *Notifier) Close() error {
if n == nil {
return nil
}
return n.wc.Close()
}