models

package
v0.0.0-...-4f57c4f Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompareResponse

type CompareResponse struct {
	Path string
	Tag  string
}

CompareResponse is for comparing directory diffs between times. Tag is used for labeling files as added, updated, or unchanged.

type Directory

type Directory struct {
	// contains filtered or unexported fields
}

Directory Model

func NewDirectory

func NewDirectory(ctx *utils.Context) *Directory

NewDirectory makes a new directory instance

func (*Directory) CompareListing

func (d *Directory) CompareListing(pathName string, startDate string,
	endDate string) ([]CompareResponse, error)

CompareListing compares the directory state betwen the startDate and endDate and returns a file listing of CompareResponses.

func (*Directory) GetPast

func (d *Directory) GetPast(pathName string, inputTime string,
	output string) ([]Entry, error)

GetPast gets the approximate directory listing at a point in time from the Db.

type Entry

type Entry struct {
	Path    string `json:",omitempty"`
	Version int    `json:",omitempty"`
	ModTime string `json:",omitempty"`
	URL     string `json:",omitempty"`
}

Entry contains info about a file version entry for formatting

type File

type File struct {
	// contains filtered or unexported fields
}

File Model

func NewFile

func NewFile(ctx *utils.Context) *File

NewFile returns a new file instance

func (*File) GetAtTime

func (f *File) GetAtTime(path string,
	inputTime string) (Entry, error)

GetAtTime gets the file version at/just before the given time.

func (*File) GetHistory

func (f *File) GetHistory(path string) ([]Entry, error)

GetHistory gets the revision history of a file. Gets list of versions and modTimes.

func (*File) GetVersion

func (f *File) GetVersion(path string,
	version string) (Entry, error)

GetVersion gets the response for a file and version.

type Metadata

type Metadata struct {
	Path       string
	Version    int
	ModTime    sql.NullString
	ArchiveKey sql.NullString
}

Metadata about a file version from the db

Jump to

Keyboard shortcuts

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