Documentation ¶
Index ¶
- Constants
- func BytesToString(bytes []byte) string
- func CopySSH(host string, username string, key string, reader io.Reader, targetPath string, ...) error
- func CreateSelfSignedTLSConfig(organization string, host string) (*tls.Config, error)
- func CreateTLSConfig(certificate []byte, key []byte) (*tls.Config, error)
- func CreateX509Certificate(organization string, host string, rsa bool, ca bool) (*x509.Certificate, error)
- func DoesFileExist(path string) (bool, error)
- func DumpIPAddress(address any)
- func ExecSSH(host string, username string, key string, stdin io.Reader, command ...string) (string, error)
- func Exit(code int)
- func ExitOnSIGTERM()
- func Fail(message string)
- func FailOnError(err error)
- func Failf(f string, args ...any)
- func FromBase64(b64 string) ([]byte, error)
- func GetFileHash(path string) (string, error)
- func GetGoBin() (string, error)
- func GetGoPath() (string, error)
- func IsFileExecutable(mode fs.FileMode) bool
- func IsFileHidden(path string) bool
- func IsIPv6(address string) bool
- func IsUDPAddrEqual(a *net.UDPAddr, b *net.UDPAddr) bool
- func JoinIPAddressPort(address string, port int) string
- func JoinQuote(strings []string, separator string) string
- func JoinQuoteL(strings []string, separator string, lastSeparator string, ...) string
- func MarshalMessagePack(value any) ([]byte, error)
- func NewMessagePackDecoder(reader io.Reader) *msgpack.Decoder
- func NewMessagePackEncoder(writer io.Writer) *msgpack.Encoder
- func NewMockLocker() sync.Locker
- func ParseX509CertPool(bytes []byte) (*x509.CertPool, error)
- func ParseX509Certificates(bytes []byte) ([]*x509.Certificate, error)
- func ReaderSize(reader io.Reader) (int64, error)
- func ResetAdHocLocks()
- func SanitizeFilename(name string) string
- func SetFlagsFromEnvironment(prefix string)
- func SetupSignalHandler() <-chan struct{}
- func SignX509Certificate(certificate *x509.Certificate, privateKey any, publicKey any) (*x509.Certificate, error)
- func SortedMapStringStringKeys(map_ map[string]string) []string
- func StringToBytes(string_ string) (bytes []byte)
- func ToBase64(bytes []byte) string
- func ToBroadcastIPAddress(address string) (string, error)
- func ToBytes(content any) []byte
- func ToDromedaryCase(name string) string
- func ToKebabCase(name string) string
- func ToRawTerminal(f func() error)
- func ToReachableIPAddress(address string) (string, error)
- func ToSnakeCase(name string) string
- func ToString(value any) string
- func ToStrings(values []any) []string
- func Touch(path string, permissions fs.FileMode, dirPermissions fs.FileMode) error
- func UnmarshalMessagePack(data []byte, value any) error
- func WriteNewline(writer io.Writer) error
- type BufferedWriter
- type ChannelReader
- type ChannelWriter
- type CoordinatedWork
- type ExitFunctionHandle
- type ForceHTTPSRoundTripper
- type LockType
- type LockableEntity
- type MockLocker
- type MockRWLocker
- type NamedPipe
- type Promise
- type RWLocker
- type SyncedWriter
- type TarEncoder
- type TestLogWriter
Constants ¶
const ( DEFAULT_LOCK = LockType(0) SYNC_LOCK = LockType(1) DEBUG_LOCK = LockType(2) MOCK_LOCK = LockType(3) )
const BUFFER_SIZE = 65536
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
This casting *does not* copy data. Note that casting via "string(value)" *does* copy data.
func CreateSelfSignedTLSConfig ¶ added in v0.1.38
func CreateTLSConfig ¶ added in v0.1.38
func CreateX509Certificate ¶ added in v0.1.38
func DoesFileExist ¶ added in v0.1.59
func DumpIPAddress ¶ added in v0.1.60
func DumpIPAddress(address any)
func ExitOnSIGTERM ¶ added in v0.1.33
func ExitOnSIGTERM()
func FailOnError ¶
func FailOnError(err error)
func FromBase64 ¶ added in v0.1.4
func GetFileHash ¶
func IsFileExecutable ¶ added in v0.1.59
func IsFileHidden ¶ added in v0.1.59
func JoinIPAddressPort ¶ added in v0.1.60
func JoinQuoteL ¶ added in v0.1.60
func MarshalMessagePack ¶ added in v0.1.62
func NewMessagePackDecoder ¶ added in v0.1.62
func NewMessagePackEncoder ¶ added in v0.1.62
func NewMockLocker ¶ added in v0.1.51
func ParseX509CertPool ¶ added in v0.1.6
func ParseX509Certificates ¶ added in v0.1.6
func ParseX509Certificates(bytes []byte) ([]*x509.Certificate, error)
func ResetAdHocLocks ¶ added in v0.1.51
func ResetAdHocLocks()
func SanitizeFilename ¶
func SetFlagsFromEnvironment ¶
func SetFlagsFromEnvironment(prefix string)
func SetupSignalHandler ¶
func SetupSignalHandler() <-chan struct{}
SetupSignalHandler registered for SIGTERM and SIGINT. A stop channel is returned which is closed on one of these signals. If a second signal is caught, the program is terminated with exit code 1.
func SignX509Certificate ¶ added in v0.1.38
func SignX509Certificate(certificate *x509.Certificate, privateKey any, publicKey any) (*x509.Certificate, error)
func StringToBytes ¶
This casting *does not* copy data. Note that casting via "[]byte(value)" *does* copy data.
func ToBroadcastIPAddress ¶ added in v0.1.60
func ToDromedaryCase ¶ added in v0.1.61
func ToKebabCase ¶ added in v0.1.61
func ToRawTerminal ¶ added in v0.1.63
func ToRawTerminal(f func() error)
func ToReachableIPAddress ¶ added in v0.1.60
func ToSnakeCase ¶ added in v0.1.61
func UnmarshalMessagePack ¶ added in v0.1.62
func WriteNewline ¶ added in v0.1.27
Types ¶
type BufferedWriter ¶ added in v0.1.22
type BufferedWriter struct {
// contains filtered or unexported fields
}
func NewBufferedWriter ¶ added in v0.1.22
func NewBufferedWriter(writer io.Writer, size int) BufferedWriter
func (BufferedWriter) Close ¶ added in v0.1.22
func (self BufferedWriter) Close() error
io.Closer interface
type ChannelReader ¶ added in v0.1.59
type ChannelReader struct {
// contains filtered or unexported fields
}
func NewChannelReader ¶ added in v0.1.59
func NewChannelReader(ch chan []byte) *ChannelReader
type ChannelWriter ¶ added in v0.1.57
type ChannelWriter struct {
// contains filtered or unexported fields
}
func NewChannelWriter ¶ added in v0.1.57
func NewChannelWriter(ch chan []byte) *ChannelWriter
type CoordinatedWork ¶ added in v0.1.52
func NewCoordinatedWork ¶ added in v0.1.52
func NewCoordinatedWork() *CoordinatedWork
type ExitFunctionHandle ¶ added in v0.1.22
type ExitFunctionHandle uint64
func OnExit ¶ added in v0.1.22
func OnExit(exitFunction func()) ExitFunctionHandle
func OnExitError ¶ added in v0.1.50
func OnExitError(exitFunction func() error) ExitFunctionHandle
func (ExitFunctionHandle) Cancel ¶ added in v0.1.22
func (self ExitFunctionHandle) Cancel()
type ForceHTTPSRoundTripper ¶ added in v0.1.4
type ForceHTTPSRoundTripper struct {
// contains filtered or unexported fields
}
func NewForceHTTPSRoundTripper ¶ added in v0.1.4
func NewForceHTTPSRoundTripper(roundTripper http.RoundTripper) *ForceHTTPSRoundTripper
type LockableEntity ¶ added in v0.1.51
type LockableEntity interface {
GetEntityLock() RWLocker
}
type MockLocker ¶ added in v0.1.51
type MockLocker struct{}
type MockRWLocker ¶ added in v0.1.51
type MockRWLocker struct {
MockLocker
}
func (MockRWLocker) RLocker ¶ added in v0.1.51
func (self MockRWLocker) RLocker() sync.Locker
RWLocker interface
func (MockRWLocker) RUnlock ¶ added in v0.1.51
func (self MockRWLocker) RUnlock()
RWLocker interface
type NamedPipe ¶ added in v0.1.58
type NamedPipe struct {
// contains filtered or unexported fields
}
func NewTempNamedPipe ¶ added in v0.1.58
type Promise ¶ added in v0.1.52
type Promise chan struct{}
func NewPromise ¶ added in v0.1.52
func NewPromise() Promise
type RWLocker ¶ added in v0.1.51
func GetAdHocLock ¶ added in v0.1.51
Warning: Because pointers can be re-used after the resource is freed, there is no way for us to guarantee ad-hoc locks would not be reused Thus this facililty should only be used for objects with a known and managed life span.
func GetEntityLock ¶ added in v0.1.51
func NewDebugRWLocker ¶ added in v0.1.51
func NewDebugRWLocker() RWLocker
func NewDefaultRWLocker ¶ added in v0.1.51
func NewDefaultRWLocker() RWLocker
func NewMockRWLocker ¶ added in v0.1.51
func NewMockRWLocker() RWLocker
func NewRWLocker ¶ added in v0.1.51
func NewSyncRWLocker ¶ added in v0.1.52
func NewSyncRWLocker() RWLocker
type SyncedWriter ¶ added in v0.1.22
func NewSyncedWriter ¶ added in v0.1.22
func NewSyncedWriter(writer io.Writer) *SyncedWriter
func (*SyncedWriter) Close ¶ added in v0.1.22
func (self *SyncedWriter) Close() error
io.Closer interface
type TarEncoder ¶
type TarEncoder struct {
// contains filtered or unexported fields
}
func NewTarEncoder ¶
func NewTarEncoder(reader io.Reader, name string, size int64) *TarEncoder
func (*TarEncoder) Drain ¶
func (self *TarEncoder) Drain()
func (*TarEncoder) Encode ¶
func (self *TarEncoder) Encode() io.Reader
type TestLogWriter ¶ added in v0.1.51
type TestLogWriter struct {
// contains filtered or unexported fields
}
func NewTestLogWriter ¶ added in v0.1.51
func NewTestLogWriter(t *testing.T) *TestLogWriter