Documentation ¶
Index ¶
Constants ¶
const ( FileWriterChmod = 0600 FileTypeTag = "file" // Multi-threading the dump with one worker for each types // The number of workers is set to the number of differents entities (roles, pods, ...) // 1 thread per k8s object type to pull from the Kubernetes API // 0 means as many thread as k8s entity types (calculated by the dumper_pipeline) FileWriterWorkerNumber = 0 )
const ( TarWriterExtension = ".tar.gz" TarWriterChmod = 0600 TarTypeTag = "tar" // Multi-threading the dump with one worker for each types // The number of workers is set to the number of differents entities (roles, pods, ...) // 1 thread per k8s object type to pull from the Kubernetes API // 0 means as many thread as k8s entity types (calculated by the dumper_pipeline) TarWorkerNumber = 0 )
const (
FSWriterChmod = 0600
)
const (
WriterDirMod = 0700
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DumperWriter ¶
type DumperWriter interface { Write(context.Context, []byte, string) error Flush(context.Context) error Close(context.Context) error // Multi-threading the dump with one worker for each types // The number of workers is set to 7 to have one thread per k8s object type to pull fronm the Kubernetes API // Using single thread when zipping to avoid concurency issues WorkerNumber() int OutputPath() string }
The DumperWriter handle multiple types of writer (file, tar, ...) It is used to centralized all writes and therefore handle all the files at once Some of the writers support multi-threading (WorkerNumber to retrieve the info)
func DumperWriterFactory ¶
type FSWriter ¶
type FSWriter struct {
// contains filtered or unexported fields
}
The FileWriter uses a map of buffers to write data to files Each file has its own buffer to optimize IO calls
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
The FileWriter uses a map of buffers to write data to files Each file has its own buffer to optimize IO calls
func NewFileWriter ¶
func (*FileWriter) Flush ¶
func (f *FileWriter) Flush(ctx context.Context) error
No flush needed for the file writer as we are flushing the buffer at every write
func (*FileWriter) OutputPath ¶
func (f *FileWriter) OutputPath() string
func (*FileWriter) WorkerNumber ¶
func (f *FileWriter) WorkerNumber() int
type TarWriter ¶
type TarWriter struct {
// contains filtered or unexported fields
}
TarWriter keeps track of all handlers used to create the tar file The write occurs in memory and is flushed to the file at the end of the process
func NewTarWriter ¶
func (*TarWriter) Close ¶
Close all the handler used to write the tar file Need to be closed only when all assets are dumped
func (*TarWriter) Flush ¶
Flush function flushes all kubernetes object from the buffers to the tar file