Versions in this module Expand all Collapse all v1 v1.2.1 Mar 7, 2023 Changes in this version + const SaltLength + var AES128GCM = &Encoding + var AES256GCM = &Encoding + func EncodeString(key []byte, content string) ([]byte, error) + func Handler(key []byte, recordSize int, h http.Handler) http.Handler + func NewRandomSalt() []byte + func Pipe(src io.Reader, key []byte, recordSize int, keyID string) (io.ReadCloser, error) + type Cipher []byte + func (c *Cipher) Scan(src any) error + func (c *Cipher) UnmarshalJSON(b []byte) error + type Client struct + Strict bool + func NewClient(keyID string, key []byte) (*Client, error) + func (c *Client) Do(req *http.Request) (*http.Response, error) + func (c *Client) Get(url string) (*http.Response, error) + func (c *Client) Post(url, contentType string, body io.Reader) (*http.Response, error) + type Encoding struct + Bits int + Name string + func EncodingFromString(encoding string) (*Encoding, bool) + func (e *Encoding) NewReader(key []byte, r io.ReadCloser) (io.Reader, error) + func (e *Encoding) NewWriter(key, salt []byte, recordSize int, keyID string, w io.Writer) (io.Writer, error) + func (e *Encoding) RandomKey() []byte + func (e *Encoding) String() string + type Error struct + func (err *Error) Error() string + func (err *Error) Unwrap() error + type Header []byte + func NewHeader(salt []byte, recordSize int, keyID string) (Header, error) + func (h *Header) ReadFrom(r io.Reader) (n int64, err error) + func (h Header) KeyID() string + func (h Header) RecordSize() int + func (h Header) Salt() []byte + type Reader struct + Header Header + func NewReader(key []byte, r io.Reader) *Reader + func (d *Reader) Close() error + func (d *Reader) Read(p []byte) (n int, err error) + func (d *Reader) WriteTo(dst io.Writer) (n int64, err error) + type ResponseWriter struct + func NewResponseWriter(key []byte, recordSize int, w http.ResponseWriter) (*ResponseWriter, error) + func (w *ResponseWriter) Flush() + func (w *ResponseWriter) Write(p []byte) (int, error) + type Writer struct + func NewWriter(key, salt []byte, recordSize int, keyID string, w io.Writer) (*Writer, error) + func (e *Writer) Close() (err error) + func (e *Writer) Flush() + func (e *Writer) ReadFrom(r io.Reader) (n int64, err error) + func (e *Writer) Write(p []byte) (n int, err error)