catalog

package
v4.1.23 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListTimeBucketKeyNames added in v4.0.1

func ListTimeBucketKeyNames(d *Directory) []string

ListTimeBucketKeyNames returns the list of TimeBucket keys in "{symbol}/{timeframe}/{atrributeGroup}" format.

Types

type Directory

type Directory struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDirectory

func NewDirectory(rootPath string) (*Directory, error)

NewDirectory scans files under the rootPath and return a new Directory struct. - returns ErrCategoryFileNotFound when "category_name" file is not found under each subdirectory, - returns an error in other unexpected cases.

func (*Directory) AddFile

func (d *Directory) AddFile(newYear int16) (fInfoPtr *io.TimeBucketInfo, err error)

func (*Directory) AddTimeBucket

func (d *Directory) AddTimeBucket(tbk *io.TimeBucketKey, f *io.TimeBucketInfo) (err error)

AddTimeBucket adds a (possibly) new data item to a rootpath. Takes an existing catalog directory and adds the new data item to that data directory. This is used only for a root category directory.

func (*Directory) DirHasDataFiles

func (d *Directory) DirHasDataFiles() bool

func (*Directory) DirHasSubDirs

func (d *Directory) DirHasSubDirs() bool

func (*Directory) GatherCategoriesAndItems

func (d *Directory) GatherCategoriesAndItems() (map[string]map[string]int, error)

func (*Directory) GatherCategoriesFromCache

func (d *Directory) GatherCategoriesFromCache() (catSet map[string]struct{}, err error)

func (*Directory) GatherDirectories added in v4.1.2

func (d *Directory) GatherDirectories() ([]string, error)

func (*Directory) GatherFilePaths added in v4.1.2

func (d *Directory) GatherFilePaths() ([]string, error)

func (*Directory) GatherTimeBucketInfo

func (d *Directory) GatherTimeBucketInfo() ([]*io.TimeBucketInfo, error)

func (*Directory) GetCategory

func (d *Directory) GetCategory() string

func (*Directory) GetDataShapes

func (d *Directory) GetDataShapes(key *io.TimeBucketKey) (dsv []io.DataShape, err error)

func (*Directory) GetLatestTimeBucketInfoFromFullFilePath

func (d *Directory) GetLatestTimeBucketInfoFromFullFilePath(fullFilePath string) (fi *io.TimeBucketInfo, err error)

func (*Directory) GetLatestTimeBucketInfoFromKey

func (d *Directory) GetLatestTimeBucketInfoFromKey(key *io.TimeBucketKey) (fi *io.TimeBucketInfo, err error)

func (*Directory) GetLatestYearFile added in v4.1.2

func (d *Directory) GetLatestYearFile() (latestFile *io.TimeBucketInfo, err error)

func (*Directory) GetListOfSubDirs

func (d *Directory) GetListOfSubDirs() (subDirList []*Directory)

func (*Directory) GetName

func (d *Directory) GetName() string

func (*Directory) GetOwningSubDirectory

func (d *Directory) GetOwningSubDirectory(fullFilePath string) (subDir *Directory, err error)

func (*Directory) GetPath

func (d *Directory) GetPath() string

func (*Directory) GetSubDirWithItemName

func (d *Directory) GetSubDirWithItemName(itemName string) (subDir *Directory)

func (*Directory) GetSubDirectoryAndAddFile

func (d *Directory) GetSubDirectoryAndAddFile(fullFilePath string, year int16) (*io.TimeBucketInfo, error)

func (*Directory) GetTimeBucketInfoSlice

func (d *Directory) GetTimeBucketInfoSlice() (tbinfolist []*io.TimeBucketInfo)

func (*Directory) PathToTimeBucketInfo

func (d *Directory) PathToTimeBucketInfo(path2 string) (*io.TimeBucketInfo, error)

func (*Directory) RemoveTimeBucket

func (d *Directory) RemoveTimeBucket(tbk *io.TimeBucketKey) (err error)

RemoveTimeBucket deletes the item at the last level specified in the dataItemKey Also removes empty directories at the higher levels after the delete. This is used for a root catalog directory.

func (*Directory) String

func (d *Directory) String() string

type ErrCategoryFileNotFound added in v4.1.1

type ErrCategoryFileNotFound struct {
	// contains filtered or unexported fields
}

ErrCategoryFileNotFound is used when "category_name" file under each data directory is not found.

func (ErrCategoryFileNotFound) Error added in v4.1.1

func (e ErrCategoryFileNotFound) Error() string

type FileAlreadyExists

type FileAlreadyExists string

func (FileAlreadyExists) Error

func (msg FileAlreadyExists) Error() string

type NotFoundError

type NotFoundError string

func (NotFoundError) Error

func (msg NotFoundError) Error() string

type PathNotContainedInExistingCategory

type PathNotContainedInExistingCategory string

func (PathNotContainedInExistingCategory) Error

type SubdirectoryDoesNotContainFiles

type SubdirectoryDoesNotContainFiles string

func (SubdirectoryDoesNotContainFiles) Error

type UnableToCreateFile

type UnableToCreateFile string

func (UnableToCreateFile) Error

func (msg UnableToCreateFile) Error() string

type UnableToLocateSubDir

type UnableToLocateSubDir string

func (UnableToLocateSubDir) Error

func (msg UnableToLocateSubDir) Error() string

type UnableToWriteHeader

type UnableToWriteHeader string

func (UnableToWriteHeader) Error

func (msg UnableToWriteHeader) Error() string

Jump to

Keyboard shortcuts

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