Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StartIndexer ¶
func StartIndexer(confs []blockstack.ServerConfig)
StartIndexer returns a Indexer
Types ¶
type Account ¶
type Account struct {
Type string `json:"@type"`
Service string `json:"service"`
ProofType string `json:"proofType"`
Identifier string `json:"identifier"`
ProofURL string `json:"proofUrl"`
}
Account models a social media proof
type Claim ¶
type Claim struct {
Type string `json:"@type"`
Image []Image `json:"image"`
Account []Account `json:"account"`
}
Claim contains social proofs and images
type DecodedToken ¶
type DecodedToken struct {
Payload Payload `json:"payload"`
Signature string `json:"signature"`
Header Header `json:"header"`
}
DecodedToken contains most of the profile information
type Domain ¶
type Domain struct {
Name string `json:"name"`
Address string `json:"address"`
Zonefile *Zonefile `json:"zonefile"`
Profile *Profile `json:"profile"`
LegacyProfile *LegacyProfile `json:"legacy_profile"`
// contains filtered or unexported fields
}
Domain models a Blockstack domain name
func (*Domain) AddZonefile ¶
AddZonefile takes a string representation of a Zonefile and parses out some info
func (*Domain) ResolveProfile ¶
func (d *Domain) ResolveProfile(sem chan struct{})
ResolveProfile takes an initialized domain and fetches the resulting profile for that domain
type Image ¶
type Image struct {
Type string `json:"@type"`
ContentURL string `json:"contentUrl"`
Name string `json:"name"`
}
Image models a Profile Image
type Indexer ¶
type Indexer struct {
StartBlock int
CurrentBlock int
Names []*Domain
ExpectedNames int
NameZonefileHash map[string]string
sync.Mutex
// contains filtered or unexported fields
}
The Indexer talks to blockstack-core and resolves all the domains and subdomains - hopefully
func (*Indexer) Client ¶
func (i *Indexer) Client() *blockstack.Client
Client provides a convinent interface to loop through provided multiple clients
func (*Indexer) GetZonefilesByBlock ¶
GetZonefilesByBlock returns a map[name]zonefile TODO: Parallelize - difficult, need to keep blocks in order. Maybe hold off on this
type LegacyProfile ¶
type LegacyProfile struct {
Account []struct {
Type string `json:"@type"`
Identifier string `json:"identifier"`
Service string `json:"service"`
} `json:"account"`
Avatar struct {
URL string `json:"url"`
} `json:"avatar"`
Bio string `json:"bio"`
Bitcoin struct {
Address string `json:"address"`
} `json:"bitcoin"`
Cover struct {
URL string `json:"url"`
} `json:"cover"`
Facebook struct {
Proof struct {
URL string `json:"url"`
} `json:"proof"`
Username string `json:"username"`
} `json:"facebook"`
Github struct {
Proof struct {
URL string `json:"url"`
} `json:"proof"`
Username string `json:"username"`
} `json:"github"`
Linkedin struct {
URL string `json:"url"`
} `json:"linkedin"`
Location struct {
Formatted string `json:"formatted"`
} `json:"location"`
Name struct {
Formatted string `json:"formatted"`
} `json:"name"`
Pgp struct {
Fingerprint string `json:"fingerprint"`
URL string `json:"url"`
} `json:"pgp"`
Twitter struct {
Proof struct {
URL string `json:"url"`
} `json:"proof"`
Username string `json:"username"`
} `json:"twitter"`
V string `json:"v"`
Website string `json:"website"`
}
LegacyProfile models a zonefile that holds the full profile format
type Payload ¶
type Payload struct {
Claim Claim `json:"claim"`
IssuedAt string `json:"issuedAt"`
Subject PublicKey `json:"subject"`
Issuer PublicKey `json:"issuer"`
ExpiresAt string `json:"expiresAt"`
}
Payload contains social media claim info and other
type Profile ¶
type Profile struct {
Token string `json:"token"`
ParentPublicKey string `json:"parentPublicKey"`
Encrypted bool `json:"encrypted"`
DecodedToken DecodedToken `json:"decodedToken"`
}
Profile models a blockstack profile