rpaste/modules/paste/fpaste.go

32 lines
669 B
Go
Raw Normal View History

2021-12-24 09:01:22 +00:00
// support for fpaste
package paste
2021-12-29 00:52:28 +00:00
import (
"fmt"
"os/user"
)
2021-12-24 09:01:22 +00:00
var (
fpasteTimeMap = map[string]string{
2021-12-29 00:52:28 +00:00
"1hour": "60",
"1day": "1440",
"1week": "10080",
2021-12-24 09:01:22 +00:00
}
2021-12-29 00:52:28 +00:00
fpasteAPIKey = "5uZ30dTZE1a5V0WYhNwcMddBRDpk6UzuzMu-APKM38iMHacxdA0n4vCqA34avNyt"
fpasteUserAgent = "fpaste/0.4.0.0"
fpasteTitle = "UNTITLED" // we'll need to make this changeable in the future
fpastePrivate = "1"
fpasteUserName = "user"
2021-12-24 09:01:22 +00:00
)
2021-12-29 00:52:28 +00:00
func Fpaste(life string, lexer string, fileContent string) error {
// Set username as the author
user, err := user.Current()
if err != nil {
fmt.Println("Username could not be found")
} else {
fpasteUserName = user.Name
}
return nil
}