working commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2019 Oleg Borodin <borodin@unix7.org>
|
||||
*/
|
||||
|
||||
package auxtool
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
func RandomString(n int) string {
|
||||
const letters = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
arr := make([]byte, n)
|
||||
for i := range arr {
|
||||
arr[i] = letters[rand.Intn(len(letters))]
|
||||
}
|
||||
return string(arr)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package auxtool
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
func TimeNow() string {
|
||||
return time.Now().Format(time.RFC3339)
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package auxuuid
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
const ZeroUUID = "00000000-0000-0000-0000-000000000000"
|
||||
|
||||
func NewUUID() string {
|
||||
return uuid.New().String()
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package client
|
||||
|
||||
|
||||
type Client struct {
|
||||
}
|
||||
|
||||
func (cli *Client) FileExists(path string) (bool, error) {
|
||||
//reqPath = fmt.Sprintf("/v3/api/file/%s", path)
|
||||
//request, err := http.NewRequest("HEAD", reqPath, nil)
|
||||
//reqPath = fmt.Sprintf("/v3/api/file/%s", path)
|
||||
//request, err := http.NewRequest("HEAD", reqPath, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user