Documentation
¶
Index ¶
- Constants
- func LoadEncryptionKey(encryptionMethod, keyFile string) ([]byte, error)
- func NewReader(lg *zap.Logger, storage storage.ExternalStorage, cfg ReaderCfg) (*loader, error)
- func NewStorage(path string) (storage.ExternalStorage, error)
- func NewWriter(lg *zap.Logger, externalStorage storage.ExternalStorage, cfg WriterCfg) (io.WriteCloser, error)
- func PreCheckMeta(externalStorage storage.ExternalStorage) error
- type Meta
- type Reader
- type ReaderCfg
- type StorageWriter
- type WriterCfg
Constants ¶
View Source
const ( EncryptPlain = "plaintext" EncryptAes = "aes256-ctr" )
Variables ¶
This section is empty.
Functions ¶
func LoadEncryptionKey ¶
func NewStorage ¶
func NewStorage(path string) (storage.ExternalStorage, error)
func NewWriter ¶
func NewWriter(lg *zap.Logger, externalStorage storage.ExternalStorage, cfg WriterCfg) (io.WriteCloser, error)
NewWriter just wraps the rotate writer. It doesn't use a buffer because Capture writes data in a big batch. Capture uses a bytes buffer to encode commands and the buffer can not be replaced with a bufio.Writer.
func PreCheckMeta ¶
func PreCheckMeta(externalStorage storage.ExternalStorage) error
Types ¶
type Meta ¶
type Meta struct {
Version string
Duration time.Duration
Cmds uint64
FilteredCmds uint64 `json:"FilteredCmds,omitempty"`
EncryptMethod string `json:"EncryptMethod,omitempty"`
}
type Reader ¶
type Reader interface {
io.ReadCloser
CurFile() string
}
type StorageWriter ¶
type StorageWriter struct {
// contains filtered or unexported fields
}
func NewStorageWriter ¶
func NewStorageWriter(writer storage.ExternalFileWriter) *StorageWriter
func (*StorageWriter) Close ¶
func (s *StorageWriter) Close() error
Click to show internal directories.
Click to hide internal directories.