Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Document ¶
type Document struct { FirstSeen time.Time `json:"first-seen"` LastSeen time.Time `json:"last-seen"` References References `json:"references"` Size uint64 `json:"size"` }
Document represents a common properties of resources in an Index.
type File ¶
type File struct { Document Content string `json:"content"` IpfsTikaVersion string `json:"ipfs_tika_version"` Language Language `json:"language"` Metadata Metadata `json:"metadata"` URLs []string `json:"urls"` NSFW *NSFW `json:"nfsw,omitempty"` }
File represents a file resource in an Index.
type Invalid ¶
type Invalid struct {
Error string `json:"error"`
}
Invalid represents invalid (unindexable) resources in an Index.
type Language ¶
type Language struct { Confidence string `json:"confidence"` Language string `json:"language"` RawScore float64 `json:"rawScore"` }
Language represents the language of a File.
type Link ¶
type Link struct { Hash string `json:"Hash"` Name string `json:"Name"` Size uint64 `json:"Size"` Type LinkType `json:"Type"` }
Link from a Document to other Documents.
type NSFW ¶
type NSFW struct { Classification NSFWClassification `json:"classification"` NSFWServerVersion string `json:"nsfwServerVersion"` ModelCID string `json:"modelCid"` }
NSFW represents nsfw-server classification.
type NSFWClassification ¶
type NSFWClassification struct { Neutral float64 `json:"neutral"` Drawing float64 `json:"drawing"` Porn float64 `json:"porn"` Hentai float64 `json:"hentai"` Sexy float64 `json:"sexy"` }
NSFWClassification represents the classification returned by nsfw-server.
type Reference ¶
type Reference struct { ParentHash string `json:"parent_hash"` Name string `json:"name"` // contains filtered or unexported fields }
Reference represents a named reference to a Document.
type References ¶
type References []Reference
References is a collection of references to a Document.
func (References) MarshalBinary ¶
func (r References) MarshalBinary() ([]byte, error)
MarshalBinary marshalls into LZ4 compressed BSON.
func (*References) UnmarshalBinary ¶
func (r *References) UnmarshalBinary(data []byte) error
UnmarshalBinary unmarshalls from LZ4 compressed BSON.
type Update ¶
type Update struct { LastSeen *time.Time `json:"last-seen,omitempty" redis:"l,omitempty"` References References `json:"references,omitempty" redis:"r,omitempty"` }
Update represents the updatable part of a Document.