Documentation ¶
Index ¶
- func CreateClientDialOpts() ([]grpc.DialOption, error)
- func HandleOSSignals(cleanup func())
- func Retry(attempts int, interval time.Duration, description string, ...) (err error)
- func Round(f float64) float64
- func RoundPlus(f float64, places int) float64
- func StdCopy2(dstout, dsterr io.Writer, src io.Reader) (written int64, err error)
- func Unzip(src, dest string) error
- func UnzipFromBytes(archive []byte, target string) error
- func Zip(source, target string) error
- func ZipToBytes(source string) ([]byte, error)
- type StdType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClientDialOpts ¶
func CreateClientDialOpts() ([]grpc.DialOption, error)
CreateClientDialOpts creates the TLC/non-TLS and other common dial options for establishing a grpc server connection to other microservices.
func HandleOSSignals ¶
func HandleOSSignals(cleanup func())
HandleOSSignals handles OS signals interrups and SIGTERM and calls cleanup()
func Retry ¶
func Retry(attempts int, interval time.Duration, description string, logr *logger.LocLoggingEntry, callback func() error) (err error)
Helper retry function
func StdCopy2 ¶
StdCopy2 is a modified version of io.Copy.
StdCopy2 will demultiplex `src`, assuming that it contains two streams, previously multiplexed together using a StdWriter instance. As it reads from `src`, StdCopy will write to `dstout` and `dsterr`.
StdCopy2 will read until it hits EOF on `src`. It will then return a nil error. In other words: if `err` is non nil, it indicates a real underlying error.
`written` will hold the total number of bytes written to `dstout` and `dsterr`.