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 ¶ added in v0.12.0
func BytesToTime ¶ added in v0.12.0
func ContainsOneOfStrings ¶ added in v0.12.0
ContainsOneOfStrings will return true if any of a group of strings is found in a given group of strings.
func ContainsString ¶ added in v0.12.0
ContainsString will return true if a string is found in a given group of strings.
func Int64ToBytes ¶ added in v0.12.0
func SplitAccount ¶
SplitAccount splits a federated account into a username and domain.
func TimeToBytes ¶ added in v0.12.0
Types ¶
type Error ¶ added in v0.18.0
type Error struct {
// contains filtered or unexported fields
}
Error represents a fedihelper specific error.
type HostMeta ¶ added in v0.18.0
func FetchHostMeta ¶ added in v0.18.0
func (*HostMeta) WebFingerURI ¶ added in v0.18.0
func (h *HostMeta) WebFingerURI() WebFingerURI
type Link ¶ added in v0.18.0
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 ¶ added in v0.18.0
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 ¶ added in v0.18.0
type NodeInfoServices struct { Inbound []string `json:"inbound"` Outbound []string `json:"outbound"` }
NodeInfoServices contains the supported services of the node.
type NodeInfoSoftware ¶ added in v0.18.0
NodeInfoSoftware contains the software and version of the node.
type NodeInfoUsage ¶ added in v0.18.0
type NodeInfoUsage struct { LocalPosts int64 `json:"localPosts"` Users NodeInfoUsageUsers `json:"users"` }
NodeInfoUsage contains usage statistics.
type NodeInfoUsageUsers ¶ added in v0.18.0
type NodeInfoUsageUsers struct {
Total int64 `json:"total"`
}
NodeInfoUsageUsers contains usage statistics about users.
type WebFingerURI ¶ added in v0.18.0
type WebFingerURI string
func (WebFingerURI) FTemplate ¶ added in v0.18.0
func (w WebFingerURI) FTemplate() string
func (WebFingerURI) String ¶ added in v0.18.0
func (w WebFingerURI) String() string
type WellKnownNodeInfo ¶ added in v0.18.0
type WellKnownNodeInfo struct {
Links []Link `json:"links"`
}
WellKnownNodeInfo is a federated well known node info object.
func FetchWellKnownNodeInfo ¶ added in v0.18.0
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 ¶ added in v0.18.0
func (w *WellKnownNodeInfo) NodeInfoURI() (*url.URL, error)