Help us shape the future of Go! Take the 2026 Go Developer Survey

store

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package store provides support for keeping track of changes to files. It can keep a copy of a file, or a patch to reverse changes to a file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(things ...string) string

Hash computes a hash of a set of strings.

Types

type Store

type Store struct {
	Dir string
}

Store is for storing change information for a set of files.

func New

func New(dir string) (*Store, error)

New generates a new Store object.

func (*Store) ApplyPatch

func (store *Store) ApplyPatch(filename, label string) error

ApplyPatch applies a patch to a file.

func (*Store) RestoreFile

func (store *Store) RestoreFile(filename, label string) error

RestoreFile restores a file from backup.

func (*Store) SaveFile

func (store *Store) SaveFile(filename, label string) error

SaveFile makes a backup of a file.

func (*Store) SavePatch

func (store *Store) SavePatch(filename, origStr, newStr, label string) error

SavePatch computes and stores the patch between to strings.

func (*Store) WriteFile

func (store *Store) WriteFile(filename string, bytes []byte) error

WriteFile writes data to a file, handling permissions.

Jump to

Keyboard shortcuts

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