move request code
parent
470ebb5507
commit
8138733bd1
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
"os/user"
|
||||
|
||||
"git.tilde.town/tildetown/town/request"
|
||||
townUser "git.tilde.town/tildetown/town/user"
|
||||
)
|
||||
|
||||
|
@ -27,12 +28,12 @@ func _main(args []string) error {
|
|||
|
||||
errs := []error{}
|
||||
|
||||
err = processGitea(requestPath)
|
||||
err = request.ProcessGitea(requestPath)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
||||
|
||||
err = processGemini(requestPath)
|
||||
err = request.ProcessGemini(requestPath)
|
||||
if err != nil {
|
||||
errs = append(errs, err)
|
||||
}
|
7
main.go
7
main.go
|
@ -1,7 +0,0 @@
|
|||
package main
|
||||
|
||||
import "git.tilde.town/tildetown/town/email"
|
||||
|
||||
func main() {
|
||||
email.SendLocalEmail("vilmibm", "testing hi", "this is a body")
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package request
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
const geminiHomeDocBase = "/home/gemini/users"
|
||||
|
||||
func processGemini(requestRootPath string) error {
|
||||
func ProcessGemini(requestRootPath string) error {
|
||||
rp := filepath.Join(requestRootPath, "gemini")
|
||||
|
||||
files, err := ioutil.ReadDir(rp)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package main
|
||||
package request
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
@ -19,7 +19,7 @@ import (
|
|||
|
||||
const pwLetters = "!@#$%^&*() []{}:;,.<>/?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890"
|
||||
|
||||
func processGitea(rp string) error {
|
||||
func ProcessGitea(rp string) error {
|
||||
apiToken := os.Getenv("GITEA_TOKEN")
|
||||
if apiToken == "" {
|
||||
return errors.New("need GITEA_TOKEN")
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
package request
|
Loading…
Reference in New Issue