Documentation ¶
Index ¶
- Constants
- func BuildStatus() (*[]Result, error)
- func CreateConfig(doc *Doc, sources *[]Source) error
- func GetAppVersion() string
- func GetItemStatus() (*map[Doc]map[ItemStatus]map[string]bool, bool, error)
- func HasMajorVersionEqualFrom() (bool, error)
- func Initialize() error
- func InsertDoc(doc *Doc) error
- func InsertItems(items *[]Item) error
- func InsertSource(source *Source) error
- func ListConfig() (*[]Config, error)
- func NewItems(identifiers *[]string, source *Source) (*[]Item, error)
- func RemoveConfigs(configs *[]Config) error
- func Update() error
- type Config
- type Doc
- type DocCategory
- type Item
- type ItemStatus
- type Result
- type Source
- type SourceCategory
Constants ¶
const ( SERROR = iota SFILEREG )
SourceCategory categories
const ( DERROR = iota DFILE DURL DFOLDER )
DocCategory categories
Variables ¶
This section is empty.
Functions ¶
func CreateConfig ¶
CreateConfig populates everything needed to create a new config entry
func GetItemStatus ¶
GetItemStatus retrieve source file status
func HasMajorVersionEqualFrom ¶
HasMajorVersionEqualFrom check if major version in given version is equal to app version
func RemoveConfigs ¶
RemoveConfigs delete one or several config group
Types ¶
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 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
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