renaming
This commit is contained in:
@ -21,30 +21,39 @@ package util
|
||||
import "fmt"
|
||||
|
||||
type URIs struct {
|
||||
HostURL string
|
||||
UserURL string
|
||||
HostURL string
|
||||
UserURL string
|
||||
StatusesURL string
|
||||
|
||||
UserURI string
|
||||
InboxURL string
|
||||
OutboxURL string
|
||||
FollowersURL string
|
||||
CollectionURL string
|
||||
StatusesURI string
|
||||
InboxURI string
|
||||
OutboxURI string
|
||||
FollowersURI string
|
||||
CollectionURI string
|
||||
}
|
||||
|
||||
func GenerateURIs(username string, protocol string, host string) *URIs {
|
||||
hostURL := fmt.Sprintf("%s://%s", protocol, host)
|
||||
userURL := fmt.Sprintf("%s/@%s", hostURL, username)
|
||||
statusesURL := fmt.Sprintf("%s/statuses", userURL)
|
||||
|
||||
userURI := fmt.Sprintf("%s/users/%s", hostURL, username)
|
||||
inboxURL := fmt.Sprintf("%s/inbox", userURI)
|
||||
outboxURL := fmt.Sprintf("%s/outbox", userURI)
|
||||
followersURL := fmt.Sprintf("%s/followers", userURI)
|
||||
collectionURL := fmt.Sprintf("%s/collections/featured", userURI)
|
||||
statusesURI := fmt.Sprintf("%s/statuses", userURI)
|
||||
inboxURI := fmt.Sprintf("%s/inbox", userURI)
|
||||
outboxURI := fmt.Sprintf("%s/outbox", userURI)
|
||||
followersURI := fmt.Sprintf("%s/followers", userURI)
|
||||
collectionURI := fmt.Sprintf("%s/collections/featured", userURI)
|
||||
return &URIs{
|
||||
HostURL: hostURL,
|
||||
UserURL: userURL,
|
||||
StatusesURL: statusesURL,
|
||||
|
||||
UserURI: userURI,
|
||||
InboxURL: inboxURL,
|
||||
OutboxURL: outboxURL,
|
||||
FollowersURL: followersURL,
|
||||
CollectionURL: collectionURL,
|
||||
StatusesURI: statusesURI,
|
||||
InboxURI: inboxURI,
|
||||
OutboxURI: outboxURI,
|
||||
FollowersURI: followersURI,
|
||||
CollectionURI: collectionURI,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user