選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

client.go 557B

123456789101112131415161718192021222324
  1. // Copyright 2021 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package lfs
  5. import (
  6. "context"
  7. "io"
  8. "net/url"
  9. )
  10. // Client is used to communicate with a LFS source
  11. type Client interface {
  12. Download(ctx context.Context, oid string, size int64) (io.ReadCloser, error)
  13. }
  14. // NewClient creates a LFS client
  15. func NewClient(endpoint *url.URL) Client {
  16. if endpoint.Scheme == "file" {
  17. return newFilesystemClient(endpoint)
  18. }
  19. return newHTTPClient(endpoint)
  20. }