mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-22 13:45:19 +00:00
fixed some comments
This commit is contained in:
parent
379b0234eb
commit
c3fb34d5b4
|
@ -23,7 +23,7 @@ type FederationHost struct {
|
||||||
Updated timeutil.TimeStamp `xorm:"updated"`
|
Updated timeutil.TimeStamp `xorm:"updated"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Factory function for PersonID. Created struct is asserted to be valid
|
// Factory function for FederationHost. Created struct is asserted to be valid.
|
||||||
func NewFederationHost(nodeInfo NodeInfo, hostFqdn string) (FederationHost, error) {
|
func NewFederationHost(nodeInfo NodeInfo, hostFqdn string) (FederationHost, error) {
|
||||||
result := FederationHost{
|
result := FederationHost{
|
||||||
HostFqdn: strings.ToLower(hostFqdn),
|
HostFqdn: strings.ToLower(hostFqdn),
|
||||||
|
@ -45,7 +45,7 @@ func (host FederationHost) Validate() []string {
|
||||||
result = append(result, fmt.Sprintf("HostFqdn has to be lower case but was: %v", host.HostFqdn))
|
result = append(result, fmt.Sprintf("HostFqdn has to be lower case but was: %v", host.HostFqdn))
|
||||||
}
|
}
|
||||||
if !host.LatestActivity.IsZero() && host.LatestActivity.After(time.Now().Add(10*time.Minute)) {
|
if !host.LatestActivity.IsZero() && host.LatestActivity.After(time.Now().Add(10*time.Minute)) {
|
||||||
result = append(result, fmt.Sprintf("Latest Activity may not be far futurer: %v", host.LatestActivity))
|
result = append(result, fmt.Sprintf("Latest Activity cannot be in the far future: %v", host.LatestActivity))
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -33,7 +33,7 @@ type NodeInfoWellKnown struct {
|
||||||
Href string
|
Href string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Factory function for PersonID. Created struct is asserted to be valid
|
// Factory function for NodeInfoWellKnown. Created struct is asserted to be valid.
|
||||||
func NewNodeInfoWellKnown(body []byte) (NodeInfoWellKnown, error) {
|
func NewNodeInfoWellKnown(body []byte) (NodeInfoWellKnown, error) {
|
||||||
result, err := NodeInfoWellKnownUnmarshalJSON(body)
|
result, err := NodeInfoWellKnownUnmarshalJSON(body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -129,7 +129,7 @@ func (c *Client) Post(b []byte, to string) (resp *http.Response, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an http GET request with forgejo/gitea specific headers
|
// Create an http GET request with forgejo/gitea specific headers
|
||||||
func (c *Client) Get(to string) (resp *http.Response, err error) { // ToDo: we might not need the b parameter
|
func (c *Client) Get(to string) (resp *http.Response, err error) {
|
||||||
var req *http.Request
|
var req *http.Request
|
||||||
emptyBody := []byte{0}
|
emptyBody := []byte{0}
|
||||||
if req, err = c.NewRequest(http.MethodGet, emptyBody, to); err != nil {
|
if req, err = c.NewRequest(http.MethodGet, emptyBody, to); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue