screenshot

package
v0.0.0-...-e57d8e2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package screenshot monitors filesystem events for screenshots added to directories and emits a screenshot event

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDir

func AddDir(w *watcher.Watcher, path string) error

AddDir adds a directory to be watched via its path

func IsOpDir

func IsOpDir(path string) (bool, error)

IsOpDir determines whether a directory is part of an active operation

func Process

func Process(path string) (ok bool, err error)

Process processes a screenshot event and stores the event in the local database

func WatchDirs

func WatchDirs() error

WatchDirs watches directories for new screenshots

Types

type Screenshot

type Screenshot struct {
	ID          bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Timestamp   time.Time     `json:"timestamp"`
	OpName      string        `json:"op_name"`
	Description string        `json:"description"`
	Filename    string        `json:"filename"`
	Hash        string        `json:"hash"`
	LocalPath   string        `json:"local_path"`
}

Screenshot describes a screenshot event

func (*Screenshot) GetDescription

func (sc *Screenshot) GetDescription() (ok bool, err error)

GetDescription gets a description string from user input via UI textbox

func (*Screenshot) HashFile

func (sc *Screenshot) HashFile() error

HashFile hashes a file with md5 and adds the hash to a Screenshot

func (*Screenshot) Rename

func (sc *Screenshot) Rename(oldName string)

Rename renames a screenshot to a given description

Jump to

Keyboard shortcuts

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