store

package
v0.0.0-...-42dca6d Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MIT Imports: 11 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// DateTimeFormat is the  format used to generate version timestamps
	DateTimeFormat = "20060102150405"
)

Variables

This section is empty.

Functions

func ExistsCache

func ExistsCache(filename string) bool

ExistsCache returns true if the file aleady exists

func GetCachePath

func GetCachePath(filename string) string

GetCachePath return the path of a file in the cache

func GetTempPath

func GetTempPath(filename string) string

GetTempPath gets the path of a temporally file

func InitCache

func InitCache(aCacheDir, aTempDir string)

InitCache Initializes cache

func WriteCache

func WriteCache(filename string, data []byte) (string, error)

WriteCache writes a cache file

func WriteTemp

func WriteTemp(data []byte) (string, error)

WriteTemp creates a temporally 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) Create

func (es *EntryStore) Create() error

Create a new repository

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) Open

func (es *EntryStore) Open() error

Open the repository

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

func (*EntryStore) StoreFile

func (es *EntryStore) StoreFile(workspace, ID string, filename string, reader io.Reader) error

StoreFile adds a new file

type FoundFile

type FoundFile struct {
	Workspace string
	ID        string
	Filename  string
}

FoundFile type

type SearchResult

type SearchResult struct {
	ID      string
	Title   string
	Matches []string
}

SearchResult is the return type for searches

type Store

type Store struct {
	Entry *EntryStore
}

Store s

func NewStore

func NewStore(path string) *Store

NewStore initializes a new store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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