Documentation
¶
Index ¶
- func NewRegistryService(site midas.Site) midas.RegistryService
- type RegistryService
- func (r *RegistryService) CloseStorage()
- func (r *RegistryService) CreateEntry(id, filename string) error
- func (r *RegistryService) CreateStorage() error
- func (r *RegistryService) DeleteEntry(id string) error
- func (r *RegistryService) Flush() error
- func (r *RegistryService) OpenStorage() error
- func (r *RegistryService) ReadEntry(id string) (string, error)
- func (r *RegistryService) RemoveStorage() error
- func (r *RegistryService) UpdateEntry(id, newFilename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRegistryService ¶
func NewRegistryService(site midas.Site) midas.RegistryService
Types ¶
type RegistryService ¶
func (*RegistryService) CloseStorage ¶
func (r *RegistryService) CloseStorage()
CloseStorage closes the file handler.
func (*RegistryService) CreateEntry ¶
func (r *RegistryService) CreateEntry(id, filename string) error
CreateEntry appends a new id to filename mapping to the registry.
func (*RegistryService) CreateStorage ¶
func (r *RegistryService) CreateStorage() error
CreateStorage creates the registry file. Equivalent of calling OpenStorage in this case.
func (*RegistryService) DeleteEntry ¶
func (r *RegistryService) DeleteEntry(id string) error
DeleteEntry removes entry with given id from the registry.
func (*RegistryService) Flush ¶
func (r *RegistryService) Flush() error
Flush writes the working changes on registry to the file.
func (*RegistryService) OpenStorage ¶
func (r *RegistryService) OpenStorage() error
OpenStorage opens the registry file (and creates it if it doesn't exist) and then unmarshals the file content into the registry.
func (*RegistryService) ReadEntry ¶
func (r *RegistryService) ReadEntry(id string) (string, error)
ReadEntry returns filename attached to given id from the registry.
func (*RegistryService) RemoveStorage ¶
func (r *RegistryService) RemoveStorage() error
RemoveStorage closes file handle and removes the registry file.
func (*RegistryService) UpdateEntry ¶
func (r *RegistryService) UpdateEntry(id, newFilename string) error
UpdateEntry sets a new filename for the id in the registry.
Click to show internal directories.
Click to hide internal directories.