Documentation
¶
Index ¶
- Constants
- func ExistsCache(filename string) bool
- func GetCachePath(filename string) string
- func GetTempPath(filename string) string
- func InitCache(aCacheDir, aTempDir string)
- func WriteCache(filename string, data []byte) (string, error)
- func WriteTemp(data []byte) (string, error)
- type Config
- type EntryStore
- func (es *EntryStore) Create() error
- func (es *EntryStore) CreateWorkspace(ws string) error
- func (es *EntryStore) DeleteEntry(workspace, ID string) error
- func (es *EntryStore) DeleteWorkspace(ws string) error
- func (es *EntryStore) FilePath(workspace, ID, filename string) string
- func (es *EntryStore) GetEntry(workspace, ID, version string) (*model.Entry, error)
- func (es *EntryStore) GetEntryVersions(workspace, ID string) ([]string, error)
- func (es *EntryStore) ListEntries(workspace string) ([]*model.Entry, error)
- func (es *EntryStore) ListFiles(workspace string) ([]FoundFile, error)
- func (es *EntryStore) ListWorkspaces() ([]string, error)
- func (es *EntryStore) NewID() string
- func (es *EntryStore) Open() error
- func (es *EntryStore) SearchEntries(workspace, expr string) ([]SearchResult, error)
- func (es *EntryStore) StoreEntry(entry *model.Entry) error
- func (es *EntryStore) StoreFile(workspace, ID string, filename string, reader io.Reader) error
- type FoundFile
- type SearchResult
- type Store
Constants ¶
const (
// DateTimeFormat is the format used to generate version timestamps
DateTimeFormat = "20060102150405"
)
Variables ¶
This section is empty.
Functions ¶
func ExistsCache ¶
ExistsCache returns true if the file aleady exists
func GetCachePath ¶
GetCachePath return the path of a file in the cache
func GetTempPath ¶
GetTempPath gets the path of a temporally file
func WriteCache ¶
WriteCache writes a cache file
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config uration for application store
type EntryStore ¶
type EntryStore struct {
Config
}
EntryStore is the store for entries
func NewEntryStore ¶
func NewEntryStore(config Config) *EntryStore
NewEntryStore creates a new entry store
func (*EntryStore) CreateWorkspace ¶
func (es *EntryStore) CreateWorkspace(ws string) error
CreateWorkspace creates a new workspace
func (*EntryStore) DeleteEntry ¶
func (es *EntryStore) DeleteEntry(workspace, ID string) error
DeleteEntry removes the specified entry
func (*EntryStore) DeleteWorkspace ¶
func (es *EntryStore) DeleteWorkspace(ws string) error
DeleteWorkspace removes a workspace
func (*EntryStore) FilePath ¶
func (es *EntryStore) FilePath(workspace, ID, filename string) string
FilePath retrieves the full path for a file
func (*EntryStore) GetEntry ¶
func (es *EntryStore) GetEntry(workspace, ID, version string) (*model.Entry, error)
GetEntry retrieves the specified entry
func (*EntryStore) GetEntryVersions ¶
func (es *EntryStore) GetEntryVersions(workspace, ID string) ([]string, error)
GetEntryVersions retrieves the versions of an entry
func (*EntryStore) ListEntries ¶
func (es *EntryStore) ListEntries(workspace string) ([]*model.Entry, error)
ListEntries retruns a list of entries
func (*EntryStore) ListFiles ¶
func (es *EntryStore) ListFiles(workspace string) ([]FoundFile, error)
ListFiles all files
func (*EntryStore) ListWorkspaces ¶
func (es *EntryStore) ListWorkspaces() ([]string, error)
ListWorkspaces returns the list of existing workspaces
func (*EntryStore) NewID ¶
func (es *EntryStore) NewID() string
NewID creates a new entry identifier
func (*EntryStore) SearchEntries ¶
func (es *EntryStore) SearchEntries(workspace, expr string) ([]SearchResult, error)
SearchEntries entries using a regular expression
func (*EntryStore) StoreEntry ¶
func (es *EntryStore) StoreEntry(entry *model.Entry) error
StoreEntry adds a new entry
type SearchResult ¶
SearchResult is the return type for searches