db

package
v0.0.0-...-7d9c67f Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client .

func (*Client) Delete

func (c *Client) Delete(id string) (err error)

Delete .

func (*Client) FindName

func (c *Client) FindName(name string) (files []FileInfo, err error)

FindName .

func (*Client) Insert

func (c *Client) Insert(d *FileInfo) (err error)

Insert .

func (*Client) LikeName

func (c *Client) LikeName(name string) (files []FileInfo, err error)

LikeName .

func (*Client) List

func (c *Client) List(count, skip int64, order string) (files []FileInfo, err error)

List .

type FileInfo

type FileInfo struct {
	ID   string `bson:"_id"`
	Name string
	Path string
	Ext  string
	Size int64
	GB   float32 // size in GigaByte

	// hash value parameters
	Byte2Hash    int64
	FingerPrint  int64
	FingerMethod string
	HashValue    []byte
	HashType     string
}

FileInfo to dedup

type IClient

type IClient interface {
	Insert(d *FileInfo) (err error)
	FindName(name string) (files []FileInfo, err error)
	LikeName(name string) (files []FileInfo, err error)
	Delete(id string) (err error)
	List(count, skip int64, order string) (files []FileInfo, err error)
}

IClient .

func NewClient

func NewClient(host string, port uint16, dbName, collName string) (client IClient, err error)

NewClient .

Jump to

Keyboard shortcuts

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