mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-22 20:57:50 +01:00
New Search Job code. Supports filtering and sorting. Renaming apiBlockRecordFile -> apiFile. Added filters and sort parameters to /search/result.
Improved API documentation. Added documentation about search filters and sort parameter.
This commit is contained in:
@@ -32,7 +32,9 @@ const (
|
||||
|
||||
// Date returns the tags data as date encoded
|
||||
func (tag *BlockRecordFileTag) Date() (time.Time, error) {
|
||||
if len(tag.Data) != 8 {
|
||||
if tag == nil {
|
||||
return time.Time{}, errors.New("tag not available")
|
||||
} else if len(tag.Data) != 8 {
|
||||
return time.Time{}, errors.New("file tag date invalid size")
|
||||
}
|
||||
|
||||
@@ -89,3 +91,14 @@ func IsTagVirtual(Type uint16) bool {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// GetTag returns the tag with the type or nil if not available.
|
||||
func (file *BlockRecordFile) GetTag(Type uint16) (tag *BlockRecordFileTag) {
|
||||
for n := range file.Tags {
|
||||
if file.Tags[n].Type == Type {
|
||||
return &file.Tags[n]
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user