Documentation
¶
Index ¶
- Constants
- Variables
- func BytesToInt64(b []byte) int64
- func BytesToTime(b []byte) time.Time
- func ContainsOneOfStrings(stack []string, needles []string) bool
- func ContainsString(stack []string, needle string) bool
- func Int64ToBytes(i int64) []byte
- func SplitAccount(act string) (username string, domain string, err error)
- func TimeToBytes(t time.Time) []byte
- type Error
- type HostMeta
- type Link
- type NodeInfo
- type NodeInfoServices
- type NodeInfoSoftware
- type NodeInfoUsage
- type NodeInfoUsageUsers
- type Software
- type WebFingerURI
- type WellKnownNodeInfo
Constants ¶
const HostMetaWebFingerTemplateRel = "lrdd"
HostMetaWebFingerTemplateRel matches a webfinger link relationship.
const NodeInfo20Schema = "http://nodeinfo.diaspora.software/ns/schema/2.0"
NodeInfo20Schema the schema url for nodeinfo 2.0.
Variables ¶
var ( // ErrInvalidAccountFormat is returned when a federated account is in an invalid format. ErrInvalidAccountFormat = NewError("invalid account format") // ErrMissingNodeInfoURI is returned a well known node info document is missing a node info url. ErrMissingNodeInfoURI = NewError("missing node info url") )
Functions ¶
func BytesToInt64 ¶
func BytesToTime ¶
func ContainsOneOfStrings ¶
ContainsOneOfStrings will return true if any of a group of strings is found in a given group of strings.
func ContainsString ¶
ContainsString will return true if a string is found in a given group of strings.
func Int64ToBytes ¶
func SplitAccount ¶
SplitAccount splits a federated account into a username and domain.
func TimeToBytes ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error represents a fedihelper specific error.
type HostMeta ¶
func FetchHostMeta ¶
func (*HostMeta) WebFingerURI ¶
func (h *HostMeta) WebFingerURI() WebFingerURI
type Link ¶
type Link struct {
Href string `json:"href,omitempty"`
Rel string `json:"rel,omitempty" xml:"rel,attr"`
Template string `json:"template,omitempty" xml:"template,attr"`
Type string `json:"type,omitempty"`
}
Link represents a link.
type NodeInfo ¶
type NodeInfo struct {
Metadata interface{} `json:"metadata"`
OpenRegistrations bool `json:"openRegistrations"`
Protocols []string `json:"protocols"`
Services NodeInfoServices `json:"services"`
Software NodeInfoSoftware `json:"software"`
Usage NodeInfoUsage `json:"usage"`
Version string `json:"version"`
}
NodeInfo is a federated node info 2.0 object.
type NodeInfoServices ¶
type NodeInfoServices struct {
Inbound []string `json:"inbound"`
Outbound []string `json:"outbound"`
}
NodeInfoServices contains the supported services of the node.
type NodeInfoSoftware ¶
NodeInfoSoftware contains the software and version of the node.
type NodeInfoUsage ¶
type NodeInfoUsage struct {
LocalPosts int64 `json:"localPosts"`
Users NodeInfoUsageUsers `json:"users"`
}
NodeInfoUsage contains usage statistics.
type NodeInfoUsageUsers ¶
type NodeInfoUsageUsers struct {
Total int64 `json:"total"`
}
NodeInfoUsageUsers contains usage statistics about users.
type WebFingerURI ¶
type WebFingerURI string
func (WebFingerURI) FTemplate ¶
func (w WebFingerURI) FTemplate() string
func (WebFingerURI) String ¶
func (w WebFingerURI) String() string
type WellKnownNodeInfo ¶
type WellKnownNodeInfo struct {
Links []Link `json:"links"`
}
WellKnownNodeInfo is a federated well known node info object.
func FetchWellKnownNodeInfo ¶
func FetchWellKnownNodeInfo(ctx context.Context, t *http.Client, domain string, config ...bool) (*WellKnownNodeInfo, error)
FetchWellKnownNodeInfo retrieves wellknown nodeinfo from a federated instance.
func (*WellKnownNodeInfo) NodeInfoURI ¶
func (w *WellKnownNodeInfo) NodeInfoURI() (*url.URL, error)