Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileModificationTime ¶
get the file modification times for a configuration file.
func HostNameToShort ¶
HostNameToShort takes a hostname which may be a Fully Qualified Domain Name or a short hostname, and returns the short hostname. If host is already a short hostname, it is returned unmodified.
func MakeNoCloser ¶
func MakeNoCloser(wr io.Writer) io.WriteCloser
Types ¶
type AtomicPtr ¶
type AtomicPtr[T any] struct { // contains filtered or unexported fields }
AtomicPtr provides atomic getting and setting of a pointer. It may be default-constructed or via NewAtomicPtr. It must not be copied after first use.
No further synchronization is provided, besides the atomic pointer exchange. If value pointed to is modified concurrently, users must perform their own synchronization.
func NewAtomicPtr ¶
NewAtomicPtr creates a new AtomicPtr[T] initialized with ptr.
func (*AtomicPtr[T]) Get ¶
func (ag *AtomicPtr[T]) Get() *T
Get returns the pointer. This is safe for multiple concurrent goroutines.
No further synchronization is provided, besides the atomic pointer exchange. If the returned object is modified concurrently, users must perform their own synchronization.
func (*AtomicPtr[T]) Set ¶
func (ag *AtomicPtr[T]) Set(ptr *T)
Set sets the AtomicPtr's pointer. This is safe for multiple concurrent goroutines.
No further synchronization is provided, besides the atomic pointer exchange. If the set object is modified concurrently, users must perform their own synchronization
type ConfigFile ¶
type NoCloser ¶
type NoCloser struct {
// contains filtered or unexported fields
}
WriteNoCloser wraps an io.Writer and returns an io.WriteCloser for which Close will be a no-op.
This allows for passing a WriteCloser to something that ordinarily takes ownership and closes, Without that Close() closing the real Writer. For example, to prevent closing os.Stdout.
This can also be used to turn an io.Writer into an io.WriteCloser.
type NopWriter ¶
type NopWriter struct{}
NopWriter is a no-op io.WriteCloser. It always returns the length of the given bytes as written. Writes to this go nowhere. Close may be called, and is also a no-op.