mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
Implemented /profile/{username} endpoint to get complete profile with signed by the current server textures.
Implemented /signing-key endpoint to get public key in der format, used to sign the textures. Improved logging of errors from http package. Changed behavior of the /cloaks endpoint
This commit is contained in:
7
utils/time.go
Normal file
7
utils/time.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package utils
|
||||
|
||||
import "time"
|
||||
|
||||
func UnixMillisecond(t time.Time) int64 {
|
||||
return t.UnixNano() / int64(time.Millisecond)
|
||||
}
|
||||
16
utils/time_test.go
Normal file
16
utils/time_test.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"testing"
|
||||
|
||||
assert "github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestUnixMillisecond(t *testing.T) {
|
||||
loc, _ := time.LoadLocation("CET")
|
||||
d := time.Date(2021, 02, 26, 00, 43, 57, 987654321, loc)
|
||||
|
||||
assert.Equal(t, int64(1614296637987), UnixMillisecond(d))
|
||||
}
|
||||
Reference in New Issue
Block a user