cpc

package
v0.0.0-...-aea4edc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package cpc provides a copy function optimized for files like SQLite that are only written at 4K page granularity. It writes the dest file in-place and tries to not write a page that's identical.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logf

type Logf func(format string, args ...interface{})

Logf is a logger that takes a format string and arguments.

type Page

type Page struct {
	Off int64 // always 4K aligned
	Len int   // usually 4K, except at the tail
}

Page is a 4K page of a file.

type Stats

type Stats struct {
	Duration        time.Duration
	PageSize        int64
	PagesWritten    int64
	PagesUnmodified int64
}

Stats contains the stats of a copy operation.

func Copy

func Copy(ctx context.Context, logf Logf, srcName, dstName string) (*Stats, error)

Copy provides a concurrent blockwise copy of srcName to dstName.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL