make it conf via arg or env

This commit is contained in:
6543 2022-07-24 17:52:07 +02:00
parent aa83b307db
commit b1b23ce2ec
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
5 changed files with 17 additions and 5 deletions

View file

@ -44,7 +44,7 @@ func joinURL(baseURL string, paths ...string) string {
return baseURL + "/" + strings.Join(p, "/")
}
func NewClient(giteaRoot, giteaAPIToken string) (*Client, error) {
func NewClient(giteaRoot, giteaAPIToken string, followSymlinks, supportLFS bool) (*Client, error) {
rootURL, err := url.Parse(giteaRoot)
giteaRoot = strings.Trim(rootURL.String(), "/")
@ -55,8 +55,8 @@ func NewClient(giteaRoot, giteaAPIToken string) (*Client, error) {
contentTimeout: 10 * time.Second,
fastClient: getFastHTTPClient(),
followSymlinks: true,
supportLFS: true,
followSymlinks: followSymlinks,
supportLFS: supportLFS,
}, err
}