Documentation ¶
Overview ¶
Package chacha20 provides a blobstore encryption wrapper using chacha20poly1305.
Index ¶
- type BackendStorage
- type Chacha20
- func (cc *Chacha20) DeleteBlobData(ctx context.Context, id blid.Blid) (bool, error)
- func (cc *Chacha20) GetBlobReader(ctx context.Context, offset uint64, id blid.Blid) (io.ReadCloser, bool, error)
- func (cc *Chacha20) GetBlobWriter(ctx context.Context, id blid.Blid) (io.Writer, func(bool) error, error)
- func (cc *Chacha20) String() string
- type Chacha20Reader
- type Chacha20Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackendStorage ¶
type BackendStorage interface { GetBlobReader(ctx context.Context, offset uint64, id blid.Blid) (io.ReadCloser, bool, error) GetBlobWriter(context.Context, blid.Blid) (io.Writer, func(bool) error, error) DeleteBlobData(context.Context, blid.Blid) (bool, error) String() string }
BackendStorage is the interface required for a supported storage.
type Chacha20 ¶
type Chacha20 struct {
// contains filtered or unexported fields
}
Chacha20 blobstore instance structure.
func New ¶
func New(envSecret string, bs BackendStorage) (*Chacha20, error)
New returns a new Chacha20 instance, taking the password from ENV[envSecret].
func (*Chacha20) DeleteBlobData ¶
DeleteBlobData deletes a blob from the backend.
func (*Chacha20) GetBlobReader ¶
func (cc *Chacha20) GetBlobReader(ctx context.Context, offset uint64, id blid.Blid) (io.ReadCloser, bool, error)
GetBlobReader returns a new blob reader.
type Chacha20Reader ¶
type Chacha20Reader struct {
// contains filtered or unexported fields
}
func (*Chacha20Reader) Close ¶
func (cr *Chacha20Reader) Close() error
type Chacha20Writer ¶
type Chacha20Writer struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.