Documentation
¶
Overview ¶
Package yagoproto holds the YaCy peer-to-peer message types: the per-endpoint request and response data transfer objects exchanged over the /yacy/* protocol, built on the value-level types in yagomodel.
Index ¶
- Constants
- Variables
- func InjectResponseHeader(dst yagomodel.Message, version string, uptime int)
- func MagicMD5(key, iam, essentials string) string
- func NetworkUnit(name string) string
- func ValidCrawlReceiptResult(result string) bool
- type CrawlReceiptRequest
- type CrawlReceiptResponse
- type CrawlURLCall
- type CrawlURLRequest
- type EndpointMethodSet
- type HelloRequest
- type HelloResponse
- type IndexRequest
- type ListRequest
- type MessageProcess
- type MessageRequest
- type MessageResponse
- type NetworkAccess
- type NetworkAuthenticationMode
- type ProfileRequest
- type QueryFieldPositions
- type QueryMatchEvidence
- type QueryMatchRange
- type QueryObject
- type QueryRequest
- type QueryRequirementPositions
- type QueryResponse
- type ResponseHeader
- type SearchAbstracts
- type SearchContentDomain
- type SearchRequest
- type SearchResponse
- type SeedlistRequest
- type TransferRWIRequest
- type TransferRWIResponse
- type TransferRWIResult
- type TransferURLRequest
- type TransferURLResponse
- type TransferURLResult
Constants ¶
View Source
const ( CrawlReceiptResultException = "exception" CrawlReceiptResultRobot = "robot" CrawlReceiptResultRejected = "rejected" CrawlReceiptResultDequeue = "dequeue" CrawlReceiptResultFill = "fill" CrawlReceiptResultUpdate = "update" CrawlReceiptResultKnown = "known" CrawlReceiptResultStale = "stale" MaximumCrawlReceiptResultBytes = 32 MaximumCrawlReceiptReasonBytes = 1024 MaximumCrawlReceiptMetadataBytes = 256 << 10 )
View Source
const ( CrawlURLResponseRejected = "rejected - insufficient call parameters" CrawlURLResponseOK = "ok" )
View Source
const ( PathHello = "/yacy/hello.html" PathTransferRWI = "/yacy/transferRWI.html" PathTransferURL = "/yacy/transferURL.html" PathSearch = "/yacy/search.html" PathQuery = "/yacy/query.html" PathIndex = "/yacy/idx.json" PathList = "/yacy/list.html" PathMessage = "/yacy/message.html" PathProfile = "/yacy/profile.html" PathCrawlURLs = "/yacy/urls.xml" PathSeedlist = "/yacy/seedlist.html" PathSeedlistJSON = "/yacy/seedlist.json" PathSeedlistXML = "/yacy/seedlist.xml" // PathP2PSeeds and PathP2PSeedsJSON mirror upstream's unauthenticated // /p2p/seeds bootstrap endpoint: the same list principal peers upload to a // bootstrap position, in the plain genSeedStr form and the peers-array // JSON form the seedlist endpoints already serve. PathP2PSeeds = "/p2p/seeds" PathP2PSeedsJSON = "/p2p/seeds.json" PathCrawlReceipt = "/yacy/crawlReceipt.html" PathYaCySearchHTML = "/yacysearch.html" PathYaCySearchJSON = "/yacysearch.json" PathYaCySearchRSS = "/yacysearch.rss" PathOpenSearch = "/opensearchdescription.xml" PathSuggestJSON = "/suggest.json" PathSuggestXML = "/suggest.xml" )
View Source
const ( EndpointMethodsGetPost = EndpointMethodGet | EndpointMethodPost EndpointMethodsPost = EndpointMethodPost )
View Source
const ( HelloEndpointMethods = EndpointMethodsGetPost TransferRWIEndpointMethods = EndpointMethodsPost TransferURLEndpointMethods = EndpointMethodsPost SearchEndpointMethods = EndpointMethodsGetPost QueryEndpointMethods = EndpointMethodsGetPost IndexEndpointMethods = EndpointMethodsGetPost ListEndpointMethods = EndpointMethodsGetPost MessageEndpointMethods = EndpointMethodsGetPost ProfileEndpointMethods = EndpointMethodsGetPost CrawlURLEndpointMethods = EndpointMethodsGetPost SeedlistEndpointMethods = EndpointMethodsGetPost CrawlReceiptEndpointMethods = EndpointMethodsPost )
View Source
const ( FieldNetworkName = "network.unit.name" FieldIam = "iam" FieldYouAre = "youare" FieldKey = "key" FieldMyTime = "mytime" FieldVersion = "version" FieldUptime = "uptime" )
View Source
const ( FieldSeed = "seed" FieldCount = "count" FieldMagicMD5 = "magicmd5" FieldYourIP = "yourip" FieldYourType = "yourtype" FieldMessage = "message" )
View Source
const ( FieldWordCount = "wordc" FieldEntryCount = "entryc" FieldIndexes = "indexes" FieldResult = "result" FieldPause = "pause" FieldUnknownURL = "unknownURL" FieldErrorURL = "errorURL" )
View Source
const ( FieldURLCount = "urlc" FieldDouble = "double" )
View Source
const ( FieldMySeed = "myseed" FieldQuery = "query" FieldExclude = "exclude" FieldURLs = "urls" FieldTime = "time" FieldMaxDist = "maxdist" FieldPartitions = "partitions" FieldAbstracts = "abstracts" FieldContentDom = "contentdom" FieldStrictContentDom = "strictContentDom" FieldTimezoneOffset = "timezoneOffset" FieldLanguage = "language" FieldModifier = "modifier" FieldPrefer = "prefer" FieldFilter = "filter" FieldConstraint = "constraint" FieldProfile = "profile" FieldSiteHost = "sitehost" FieldSiteHash = "sitehash" FieldAuthor = "author" FieldCollection = "collection" FieldFileType = "filetype" FieldProtocol = "protocol" FieldResource = "resource" FieldMaximumRecords = "maximumRecords" FieldStartRecord = "startRecord" FieldURLMaskFilter = "urlmaskfilter" FieldPreferMaskFilter = "prefermaskfilter" FieldVerify = "verify" FieldSearchTime = "searchtime" FieldReferences = "references" FieldJoinCount = "joincount" FieldLinkCount = "linkcount" FieldQueryEvidenceVersion = "yago.query.evidence.version" FieldQueryEvidenceTerm = "yago.query.evidence.term" )
View Source
const ( FieldObject = "object" FieldEnv = "env" FieldResponse = "response" FieldMagic = "magic" )
View Source
const ( FieldMessageProcess = "process" FieldMessageSize = "messagesize" FieldMessageAttachmentSize = "attachmentsize" FieldMessageSubject = "subject" )
View Source
const ( FieldReason = "reason" FieldLURLEntry = "lurlEntry" FieldDelay = "delay" )
View Source
const ( FieldCall = "call" FieldHashes = "hashes" )
View Source
const ( FieldSeedlistMaxCount = "maxcount" FieldSeedlistMinVersion = "minversion" FieldSeedlistNode = "node" FieldSeedlistMe = "me" FieldSeedlistMy = "my" FieldSeedlistID = "id" FieldSeedlistName = "name" FieldSeedlistAddress = "address" FieldSeedlistCallback = "callback" FieldSeedlistPeerName = "peername" )
View Source
const ( FieldListColumn = "col" FieldListName = "listname" )
View Source
const ( MessageResponseRejected = "-1" MessageResponsePermission = "Welcome to my peer!" MessageResponseAccepted = "Thank you!" )
View Source
const ( MessageSubjectMaximumBytes = 100 MessageBodyMaximumBytes = 10240 MessageAttachmentMaximumBytes = 0 )
View Source
const ( QueryResponseRejected = -1 QueryResponseUnresolved = "-UNRESOLVED_PATTERN-" )
View Source
const ( MaximumTransferEntries = 1000 MaximumSearchTermHashes = 32 MaximumSearchURLHashes = 128 MaximumCrawlURLHashes = MaximumTransferEntries )
View Source
const ( ResultOK = "ok" ResultWrongTarget = "wrong_target" )
View Source
const DefaultNetwork = "freeworld"
View Source
const HelloSeedMaximumUTF16Units = 16000
View Source
const (
IndexObjectHost = "host"
)
View Source
const ListColumnBlack = "black"
View Source
const (
QueryMatchEvidenceVersion = 1
)
View Source
const SeedlistMaximumEntries = 1000
Variables ¶
View Source
var ErrBadField = errors.New("bad field")
Functions ¶
func InjectResponseHeader ¶
func NetworkUnit ¶
func ValidCrawlReceiptResult ¶
Types ¶
type CrawlReceiptRequest ¶
type CrawlReceiptRequest struct {
NetworkName string
NetworkNamePresent bool
Iam yagomodel.Hash
YouAre yagomodel.Hash
Key string
MagicMD5 string
Result string
Reason string
LURLEntry string
}
func (CrawlReceiptRequest) Form ¶
func (r CrawlReceiptRequest) Form() url.Values
type CrawlReceiptResponse ¶
type CrawlReceiptResponse struct {
ResponseHeader
Delay int
}
func ParseCrawlReceiptResponse ¶
func ParseCrawlReceiptResponse(m yagomodel.Message) (CrawlReceiptResponse, error)
func (CrawlReceiptResponse) Encode ¶
func (r CrawlReceiptResponse) Encode() yagomodel.Message
type CrawlURLCall ¶
type CrawlURLCall string
const ( CrawlURLCallRemoteCrawl CrawlURLCall = "remotecrawl" CrawlURLCallURLHashList CrawlURLCall = "urlhashlist" )
type CrawlURLRequest ¶
type CrawlURLRequest struct {
NetworkName string
NetworkNamePresent bool
Iam string
YouAre string
Key string
MagicMD5 string
MyTime string
Call CrawlURLCall
Count yagomodel.Optional[int]
Time yagomodel.Optional[int]
Hashes string
}
func ParseCrawlURLRequest ¶
func (CrawlURLRequest) Form ¶
func (r CrawlURLRequest) Form() url.Values
type EndpointMethodSet ¶
type EndpointMethodSet uint8
const ( EndpointMethodGet EndpointMethodSet = 1 << iota EndpointMethodPost )
type HelloRequest ¶
type HelloRequest struct {
NetworkName string
NetworkNamePresent bool
Key string
Seed yagomodel.Seed
Count int
Iam string
MagicMD5 string
MyTime string
}
func ParseHelloRequest ¶
func (HelloRequest) Form ¶
func (r HelloRequest) Form() url.Values
type HelloResponse ¶
type HelloResponse struct {
ResponseHeader
YourIP string
YourType yagomodel.PeerType
MyTime string
Message string
Seeds []yagomodel.Seed
}
func ParseHelloResponse ¶
func (HelloResponse) Encode ¶
func (r HelloResponse) Encode() yagomodel.Message
func (HelloResponse) KnownSeeds ¶
func (r HelloResponse) KnownSeeds() []yagomodel.Seed
type IndexRequest ¶
type IndexRequest struct {
NetworkName string
NetworkNamePresent bool
Iam string
Key string
MagicMD5 string
Object string
}
func ParseIndexRequest ¶
func (IndexRequest) Form ¶
func (r IndexRequest) Form() url.Values
type ListRequest ¶
type ListRequest struct {
NetworkName string
NetworkNamePresent bool
Iam string
Key string
MagicMD5 string
Column string
Name string
}
func ParseListRequest ¶
func (ListRequest) Form ¶
func (r ListRequest) Form() url.Values
type MessageProcess ¶
type MessageProcess string
const ( MessageProcessPermission MessageProcess = "permission" MessageProcessPost MessageProcess = "post" )
type MessageRequest ¶
type MessageRequest struct {
NetworkName string
NetworkNamePresent bool
YouAre yagomodel.Hash
Iam yagomodel.Hash
Key string
MagicMD5 string
MyTime string
Process MessageProcess
MySeed yagomodel.Optional[yagomodel.Seed]
Subject string
Body string
}
func ParseMessageRequest ¶
func (MessageRequest) Form ¶
func (r MessageRequest) Form() url.Values
type MessageResponse ¶
type MessageResponse struct {
ResponseHeader
MessageSize int
AttachmentSize int
Response string
}
func ParseMessageResponse ¶
func ParseMessageResponse(m yagomodel.Message) (MessageResponse, error)
func (MessageResponse) Encode ¶
func (r MessageResponse) Encode() yagomodel.Message
type NetworkAccess ¶
type NetworkAccess struct {
NetworkName string
Mode NetworkAuthenticationMode
Essentials string
Self yagomodel.Hash
}
func (NetworkAccess) Authorizes ¶
func (a NetworkAccess) Authorizes(form url.Values) bool
func (NetworkAccess) SignWithSalt ¶
func (a NetworkAccess) SignWithSalt(form url.Values, salt string)
type NetworkAuthenticationMode ¶
type NetworkAuthenticationMode string
const ( NetworkAuthenticationUncontrolled NetworkAuthenticationMode = "uncontrolled" NetworkAuthenticationSaltedMagic NetworkAuthenticationMode = "salted-magic-sim" )
type ProfileRequest ¶
type ProfileRequest struct {
NetworkName string
NetworkNamePresent bool
Iam string
Key string
MagicMD5 string
}
func ParseProfileRequest ¶
func (ProfileRequest) Form ¶
func (r ProfileRequest) Form() url.Values
type QueryFieldPositions ¶
type QueryFieldPositions struct {
Field string `json:"f"`
Requirements []QueryRequirementPositions `json:"r"`
}
type QueryMatchEvidence ¶
type QueryMatchEvidence struct {
Version int `json:"v"`
Analyzer string `json:"a"`
RequirementOrdinals []int `json:"q"`
AbsentOrdinals []int `json:"x"`
Snippet string `json:"s,omitempty"`
SnippetMatches []QueryMatchRange `json:"m,omitempty"`
BodyMatches []QueryMatchRange `json:"b,omitempty"`
FieldPositions []QueryFieldPositions `json:"p,omitempty"`
}
type QueryMatchRange ¶
type QueryObject ¶
type QueryObject string
const ( ObjectRWICount QueryObject = "rwicount" ObjectRWIURLCount QueryObject = "rwiurlcount" ObjectLURLCount QueryObject = "lurlcount" ObjectWantedLURLs QueryObject = "wantedlurls" ObjectWantedPURLs QueryObject = "wantedpurls" ObjectWantedWord QueryObject = "wantedword" ObjectWantedRWI QueryObject = "wantedrwi" ObjectWantedSeeds QueryObject = "wantedseeds" )
type QueryRequest ¶
type QueryRequest struct {
NetworkName string
NetworkNamePresent bool
YouAre string
Iam string
Object QueryObject
Env string
Key string
MagicMD5 string
MyTime string
}
func ParseQueryRequest ¶
func (QueryRequest) Form ¶
func (r QueryRequest) Form() url.Values
type QueryResponse ¶
type QueryResponse struct {
ResponseHeader
Response int
MyTime string
Magic string
UnresolvedResponse bool
}
func ParseQueryResponse ¶
func ParseQueryResponse(m yagomodel.Message) (QueryResponse, error)
func (QueryResponse) Encode ¶
func (r QueryResponse) Encode() yagomodel.Message
type ResponseHeader ¶
type SearchAbstracts ¶
type SearchAbstracts string
const SearchAbstractsAuto SearchAbstracts = "auto"
func (SearchAbstracts) Hashes ¶
func (a SearchAbstracts) Hashes() []yagomodel.Hash
type SearchContentDomain ¶
type SearchContentDomain string
const ( ContentDomainAll SearchContentDomain = "all" ContentDomainText SearchContentDomain = "text" ContentDomainImage SearchContentDomain = "image" ContentDomainAudio SearchContentDomain = "audio" ContentDomainVideo SearchContentDomain = "video" ContentDomainApp SearchContentDomain = "app" ContentDomainCtrl SearchContentDomain = "ctrl" )
type SearchRequest ¶
type SearchRequest struct {
NetworkName string
NetworkNamePresent bool
Iam string
Key string
MagicMD5 string
MySeed yagomodel.Optional[yagomodel.Seed]
Query []yagomodel.Hash
Exclude []yagomodel.Hash
URLs []yagomodel.Hash
Count int
Time int
MaxDist int
Partitions int
Abstracts SearchAbstracts
ContentDom SearchContentDomain
StrictContentDom bool
TimezoneOffset int
Language string
Modifier string
Prefer string
Filter string
Constraint string
Profile string
SiteHost string
SiteHash string
Author string
Collection string
FileType string
Protocol string
EvidenceVersion int
EvidenceTerms []string
}
func ParseSearchRequest ¶
func (SearchRequest) Form ¶
func (r SearchRequest) Form() url.Values
type SearchResponse ¶
type SearchResponse struct {
ResponseHeader
SearchTime int
References string
JoinCount int
Count int
Resources []yagomodel.URIMetadataRow
InvalidResources int
IndexCount map[yagomodel.Hash]int
IndexAbstract map[yagomodel.Hash]string
ResourceEvidence map[yagomodel.Hash]QueryMatchEvidence
}
func ParseSearchResponse ¶
func ParseSearchResponse(m yagomodel.Message) (SearchResponse, error)
func (SearchResponse) Encode ¶
func (r SearchResponse) Encode() yagomodel.Message
type SeedlistRequest ¶
type SeedlistRequest struct {
MaxCount yagomodel.Optional[int]
MinVersion yagomodel.Optional[float64]
NodeOnly bool
IncludeSelf bool
OwnSeedOnly bool
ID yagomodel.Optional[yagomodel.Hash]
IDPresent bool
Name string
NamePresent bool
AddressOnly bool
Callback string
CallbackPresent bool
PeerName string
PeerNamePresent bool
}
func ParseSeedlistRequest ¶
func (SeedlistRequest) Form ¶
func (r SeedlistRequest) Form() url.Values
type TransferRWIRequest ¶
type TransferRWIRequest struct {
NetworkName string
NetworkNamePresent bool
Iam yagomodel.Hash
YouAre yagomodel.Hash
WordCount int
EntryCount int
Indexes []yagomodel.RWIPosting
Key string
MagicMD5 string
// contains filtered or unexported fields
}
func ParseTransferRWIRequest ¶
func (TransferRWIRequest) ExceedsEntryLimit ¶
func (r TransferRWIRequest) ExceedsEntryLimit() bool
func (TransferRWIRequest) Form ¶
func (r TransferRWIRequest) Form() url.Values
func (TransferRWIRequest) MissingEntryCountField ¶
func (r TransferRWIRequest) MissingEntryCountField() bool
func (TransferRWIRequest) MissingIndexesField ¶
func (r TransferRWIRequest) MissingIndexesField() bool
func (TransferRWIRequest) MissingWordCountField ¶
func (r TransferRWIRequest) MissingWordCountField() bool
type TransferRWIResponse ¶
type TransferRWIResponse struct {
ResponseHeader
Result TransferRWIResult
Pause int
UnknownURL []yagomodel.Hash
ErrorURL []yagomodel.Hash
UnknownURLFieldPresent bool
}
func ParseTransferRWIResponse ¶
func ParseTransferRWIResponse(m yagomodel.Message) (TransferRWIResponse, error)
func (TransferRWIResponse) Encode ¶
func (r TransferRWIResponse) Encode() yagomodel.Message
type TransferRWIResult ¶
type TransferRWIResult string
const ( ResultBusy TransferRWIResult = "busy" ResultNotGranted TransferRWIResult = "not_granted" ResultTooHighLoad TransferRWIResult = "too high load" ResultPostOrEnvIsNull TransferRWIResult = "post or env is null!" ResultNotAuthentified TransferRWIResult = "not authentified" ResultMissingWordC TransferRWIResult = "missing wordc" ResultMissingEntryC TransferRWIResult = "missing entryc" ResultMissingIndexes TransferRWIResult = "missing indexes" )
type TransferURLRequest ¶
type TransferURLRequest struct {
NetworkName string
NetworkNamePresent bool
Iam yagomodel.Hash
YouAre yagomodel.Hash
URLCount int
URLs []yagomodel.URIMetadataRow
Key string
MagicMD5 string
}
func ParseTransferURLRequest ¶
func (TransferURLRequest) Form ¶
func (r TransferURLRequest) Form() url.Values
type TransferURLResponse ¶
type TransferURLResponse struct {
ResponseHeader
Result TransferURLResult
Double int
ErrorURL []yagomodel.Hash
}
func ParseTransferURLResponse ¶
func ParseTransferURLResponse(m yagomodel.Message) (TransferURLResponse, error)
func (TransferURLResponse) Encode ¶
func (r TransferURLResponse) Encode() yagomodel.Message
type TransferURLResult ¶
type TransferURLResult string
const ResultErrorNotGranted TransferURLResult = "error_not_granted"
Source Files
¶
- crawl_receipt.go
- crawl_urls.go
- doc.go
- endpoint_path.go
- field_codec.go
- field_name.go
- hash_field.go
- hello.go
- hello_seed_boundary.go
- index.go
- java_signed_decimal.go
- list.go
- message.go
- network_authentication.go
- network_name_field.go
- profile.go
- query.go
- query_match_evidence.go
- query_match_evidence_validation.go
- query_object.go
- request_limits.go
- response_header.go
- search.go
- search_abstracts.go
- search_content_domain.go
- seedlist.go
- seedlist_version.go
- transfer_result.go
- transfer_rwi.go
- transfer_url.go
Click to show internal directories.
Click to hide internal directories.