This repository has been archived on 2025-10-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gitwarrior/internal/gitea/gitea.go
Yves Biener 854dafde01 mod(taskwarrior): complete push implementation
Currently the merging process is not working entirely as I would
expect. There are no checks for actual changes between the local version
and the server version. WIP for #3. Configuration file created with
corresponding values like, user name and access code, which are - for
obvious reasons - not commited.
2023-10-25 17:14:54 +02:00

34 lines
565 B
Go

package gitea
import (
"encoding/json"
"fmt"
"os"
)
var API_PATH = "/api/v1"
type Gitea struct {
Base_url string `json:"base_url"`
User_name string `json:"user_name"`
Access_code string `json:"access_code"`
}
func NewGitea() (gitea Gitea) {
configJson, err := os.ReadFile("./configs/gitw.json")
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(-1)
}
err = json.Unmarshal(configJson, &gitea)
if err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(-1)
}
return
}
func (gitea *Gitea) Url() string {
return gitea.Base_url + API_PATH
}