file

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SERROR = iota
	SFILEREG
)

SourceCategory categories

View Source
const (
	DERROR = iota
	DFILE
	DURL
	DFOLDER
)

DocCategory categories

Variables

This section is empty.

Functions

func BuildStatus

func BuildStatus() (*[]Result, error)

BuildStatus retrieves sources file status

func CreateConfig

func CreateConfig(doc *Doc, sources *[]Source) error

CreateConfig populates everything needed to create a new config entry

func GetAppVersion

func GetAppVersion() string

GetAppVersion return app version

func GetItemStatus

func GetItemStatus() (*map[Doc]map[ItemStatus]map[string]bool, bool, error)

GetItemStatus retrieve source file status

func HasMajorVersionEqualFrom

func HasMajorVersionEqualFrom() (bool, error)

HasMajorVersionEqualFrom check if major version in given version is equal to app version

func Initialize

func Initialize() error

Initialize initialize project

func InsertDoc

func InsertDoc(doc *Doc) error

InsertDoc create a new doc entry

func InsertItems

func InsertItems(items *[]Item) error

InsertItems create severan new items

func InsertSource

func InsertSource(source *Source) error

InsertSource create a new source entry

func ListConfig

func ListConfig() (*[]Config, error)

ListConfig return a config list

func NewItems

func NewItems(identifiers *[]string, source *Source) (*[]Item, error)

NewItems create several new items

func RemoveConfigs

func RemoveConfigs(configs *[]Config) error

RemoveConfigs delete one or several config group

func Update

func Update() error

Update all entries in items database

Types

type Config

type Config struct {
	Doc     Doc
	Sources []Source
}

Config represents a config line

type Doc

type Doc struct {
	ID         string
	Category   DocCategory
	Identifier string
	CreatedAt  time.Time
}

Doc represents a document which as relationship with one or several source files

func NewDoc

func NewDoc(identifier string, category DocCategory) *Doc

NewDoc create a new doc file

type DocCategory

type DocCategory int

DocCategory represents a doc category

type Item

type Item struct {
	ID          string
	Identifier  string
	Fingerprint string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	SourceID    string
}

Item represents an actual tracked source

type ItemStatus

type ItemStatus int

ItemStatus represents a source file status

const (
	INONE ItemStatus = iota
	IFAILED
	IADDED
	IUPDATED
	IDELETED
)

Source files status

func (ItemStatus) String

func (i ItemStatus) String() string

type Result

type Result struct {
	Doc    Doc
	Source Source
	Status map[ItemStatus][]string
}

Result represents what we get after comparison between database and actual files

type Source

type Source struct {
	ID         string
	Category   SourceCategory
	Identifier string
	CreatedAt  time.Time
	UpdatedAt  time.Time
	DocID      string
}

Source represents a source that we want to follow changes

func NewSource

func NewSource(doc *Doc, identifier string, category SourceCategory) *Source

NewSource create new source

type SourceCategory

type SourceCategory int

SourceCategory represents a source category

func ParseIdentifier

func ParseIdentifier(value string) (string, SourceCategory)

ParseIdentifier extract identifier and category from string

Jump to

Keyboard shortcuts

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