mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-05-17 02:27:10 +02:00
more caching in-client
This commit is contained in:
parent
b2b22872a2
commit
a8afb372dd
11 changed files with 95 additions and 80 deletions
|
@ -21,28 +21,28 @@ const (
|
|||
)
|
||||
|
||||
type Client struct {
|
||||
giteaRoot string
|
||||
giteaAPIToken string
|
||||
infoTimeout time.Duration
|
||||
contentTimeout time.Duration
|
||||
fastClient *fasthttp.Client
|
||||
fileResponseCache cache.SetGetKey
|
||||
giteaRoot string
|
||||
giteaAPIToken string
|
||||
infoTimeout time.Duration
|
||||
contentTimeout time.Duration
|
||||
fastClient *fasthttp.Client
|
||||
responseCache cache.SetGetKey
|
||||
|
||||
followSymlinks bool
|
||||
supportLFS bool
|
||||
}
|
||||
|
||||
func NewClient(giteaRoot, giteaAPIToken string, fileResponseCache cache.SetGetKey, followSymlinks, supportLFS bool) (*Client, error) {
|
||||
func NewClient(giteaRoot, giteaAPIToken string, respCache cache.SetGetKey, followSymlinks, supportLFS bool) (*Client, error) {
|
||||
rootURL, err := url.Parse(giteaRoot)
|
||||
giteaRoot = strings.Trim(rootURL.String(), "/")
|
||||
|
||||
return &Client{
|
||||
giteaRoot: giteaRoot,
|
||||
giteaAPIToken: giteaAPIToken,
|
||||
infoTimeout: 5 * time.Second,
|
||||
contentTimeout: 10 * time.Second,
|
||||
fastClient: getFastHTTPClient(),
|
||||
fileResponseCache: fileResponseCache,
|
||||
giteaRoot: giteaRoot,
|
||||
giteaAPIToken: giteaAPIToken,
|
||||
infoTimeout: 5 * time.Second,
|
||||
contentTimeout: 10 * time.Second,
|
||||
fastClient: getFastHTTPClient(),
|
||||
responseCache: respCache,
|
||||
|
||||
followSymlinks: followSymlinks,
|
||||
supportLFS: supportLFS,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue