types

package
v0.0.0-...-ada256f Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory

type Directory struct {
	Document

	Links Links `json:"links"`
}

Directory represents a directory resource in an Index.

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 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 LinkType

type LinkType string

LinkType represents the type of a Link as a string.

const (
	DirectoryLinkType   LinkType = "Directory"
	FileLinkType        LinkType = "File"
	UnknownLinkType     LinkType = "Unknown"
	UnsupportedLinkType LinkType = "Unsupported"
)

Values for LinkTypes.

type Links []Link

Links is a collection of links to other Documents.

type Metadata

type Metadata map[string]interface{}

Metadata represents metadata for a File.

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 Partial

type Partial struct{}

Partial represents an unreferenced partial block in an Index.

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.

Jump to

Keyboard shortcuts

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