Documentation
¶
Index ¶
- func DecryptData(secretKeyOrPwd string, ctStr string) ([]byte, error)
- func DecryptStream(secretKeyOrPwd string, dst io.Writer, src io.Reader) error
- func EncryptData(keyOrPwd string, data []byte, compress bool) (ctStr string, ctUrl string, err error)
- func EncryptStream(keyOrPwd string, dst io.Writer, src io.Reader, compress, encode bool) error
- func GetPublicKey(secretKeyOrPwd string, quantumSafe bool) (pubKeyStr, pubKeyUrl string, err error)
- func GetSanitisedKeyOrPwd(keyPwdStr string) (sanitisedKey string, isKey bool)
- func NewDecryptingReader(secretKeyOrPwd string, src io.Reader) (io.Reader, error)
- func NewEncryptingWriter(keyOrPwd string, dst io.Writer, compress, encode bool) (encryptingWriteCloser io.WriteCloser, err error)
- type ThresholdFileWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncryptData ¶
func EncryptStream ¶
func GetPublicKey ¶
func GetSanitisedKeyOrPwd ¶
func NewDecryptingReader ¶
func NewEncryptingWriter ¶
Types ¶
type ThresholdFileWriter ¶ added in v1.20.0
type ThresholdFileWriter struct {
// contains filtered or unexported fields
}
ThresholdFileWriter buffers writes until a threshold length is reached, then creates the output file, flushes the buffer, and passes all subsequent writes through.
func NewThresholdFileWriter ¶ added in v1.20.0
func NewThresholdFileWriter(filePath string, threshold int) *ThresholdFileWriter
func (*ThresholdFileWriter) Close ¶ added in v1.20.0
func (tw *ThresholdFileWriter) Close() error
Close flushes remaining data and closes the file.
func (*ThresholdFileWriter) Discard ¶ added in v1.20.0
func (tw *ThresholdFileWriter) Discard() error
Discard drops the buffer without writing and removes the file if it was already created.
func (*ThresholdFileWriter) Flush ¶ added in v1.20.0
func (tw *ThresholdFileWriter) Flush() error
Flush writes any remaining buffered data, creating the file if needed, and syncs it.
Click to show internal directories.
Click to hide internal directories.