Documentation
¶
Index ¶
- Variables
- func DiscardData(r io.Reader) error
- func LoadBase64Secret(log *slog.Logger, filename string, minLen, maxLen int) ([]byte, error)
- func LoadEd25519Base64PublicKey(log *slog.Logger, filename string) ([]byte, error)
- func LoadSHA3_512Base64Secret(log *slog.Logger, filename string) ([]byte, error)
- func LoadSHA256Base64Secret(log *slog.Logger, filename string) ([]byte, error)
- func ReadAllFunc(r io.Reader, f func([]byte) error) error
- type CancelingReadCloser
- type LimitedReadCloser
- type OnceReadCloser
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitExceeded = errors.New("limit exceeded")
ErrLimitExceeded is returned by LimitedReadCloser when the stream is longer than the limit it was given.
Functions ¶
func DiscardData ¶
DiscardData discards up to 8KiB of data from r. Function can be used to drain HTTP client response body. See https://pkg.go.dev/net/http#Response.
func LoadBase64Secret ¶
func LoadSHA256Base64Secret ¶
Types ¶
type CancelingReadCloser ¶
type CancelingReadCloser struct {
io.ReadCloser
Cancel context.CancelFunc
}
func (*CancelingReadCloser) Close ¶
func (c *CancelingReadCloser) Close() error
type LimitedReadCloser ¶ added in v19.3.0
type LimitedReadCloser struct {
io.ReadCloser
Remaining int64
}
LimitedReadCloser reads at most Remaining bytes from the embedded ReadCloser. Unlike io.LimitReader, which reports EOF at the limit, it fails with ErrLimitExceeded, so a caller can tell a stream that ended from one that was cut short.
type OnceReadCloser ¶
type OnceReadCloser struct {
io.ReadCloser
// contains filtered or unexported fields
}
func (*OnceReadCloser) Close ¶
func (oc *OnceReadCloser) Close() error
Click to show internal directories.
Click to hide internal directories.