lookup

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package lookup is bfinger's side of BRC-24: the finger lookup service's name and the two questions bfinger asks it, over the library's client (package lookup of github.com/lightwebinc/bcommon).

The client (Query, the answer types) carries no finger content and lives in the library. The service name and the shape of each question are the contract with bfinger's host module, so they stay here, beside the tests that pin their bytes. The library's names are re-exported so bfinger's callers keep one import.

Index

Constants

View Source
const ServiceFinger = "ls_finger"

ServiceFinger is the lookup service that answers for identity keys.

View Source
const TypeOutputList = bclookup.TypeOutputList

TypeOutputList is the one answer type the reader accepts.

Variables

View Source
var ErrNotOutputList = bclookup.ErrNotOutputList

ErrNotOutputList is the library's sentinel, the same value, so errors.Is matches either name.

Functions

This section is empty.

Types

type Answer

type Answer = bclookup.Answer

Answer is a BRC-24 lookup answer.

type HostAnswer

type HostAnswer = bclookup.HostAnswer

HostAnswer is one host's answer, kept with the host.

func Query

func Query(ctx context.Context, hs *hostset.Client, base string, q Question) ([]HostAnswer, error)

Query POSTs q to <base>/lookup on the hosts hs selects and decodes each answer; see the library's Query.

type Output

type Output = bclookup.Output

Output is one item of an output-list answer.

type Question

type Question = bclookup.Question

Question is the body of POST /lookup.

func CarrierQuestion

func CarrierQuestion(identityKey []byte, c [32]byte) Question

CarrierQuestion is the sub-store question of spec section 14.3: one carrier under one identity, by its commitment. The host answers only that it holds that carrier under that identity; membership of a store is the reader's own check. c is the commitment in hash byte order, as a record carries it; the wire wants display order, which is what chainhash's String gives.

func FingerQuestion

func FingerQuestion(identityKey []byte) Question

FingerQuestion is the question the finger lookup service parses: the identity key, hex, and nothing else. The bytes it marshals to are pinned by testdata/fixtures/lookup_question_finger.json, because the host module parses exactly that shape and a renamed member would be a query that silently matches nothing.

Jump to

Keyboard shortcuts

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