fix: `model.Link` marshal error (close #4971)

ignore unsupported filed of `model.Link`
pull/4978/head
Andy Hsu 2023-08-09 14:04:31 +08:00
parent b91ed7a78a
commit 9d45718e5f
1 changed files with 8 additions and 7 deletions

View File

@ -1,11 +1,12 @@
package model package model
import ( import (
"github.com/alist-org/alist/v3/pkg/http_range"
"github.com/alist-org/alist/v3/pkg/utils"
"io" "io"
"net/http" "net/http"
"time" "time"
"github.com/alist-org/alist/v3/pkg/http_range"
"github.com/alist-org/alist/v3/pkg/utils"
) )
type ListArgs struct { type ListArgs struct {
@ -23,14 +24,14 @@ type LinkArgs struct {
type Link struct { type Link struct {
URL string `json:"url"` URL string `json:"url"`
Header http.Header `json:"header"` // needed header (for url) or response header(for data or writer) Header http.Header `json:"header"` // needed header (for url) or response header(for data or writer)
RangeReadCloser RangeReadCloser // recommended way RangeReadCloser RangeReadCloser `json:"-"` // recommended way
ReadSeekCloser io.ReadSeekCloser // best for local,smb.. file system, which exposes ReadSeekCloser ReadSeekCloser io.ReadSeekCloser `json:"-"` // best for local,smb... file system, which exposes ReadSeekCloser
Expiration *time.Duration // local cache expire Duration Expiration *time.Duration // local cache expire Duration
IPCacheKey bool // add ip to cache key IPCacheKey bool `json:"-"` // add ip to cache key
//for accelerating request, use multi-thread downloading //for accelerating request, use multi-thread downloading
Concurrency int Concurrency int `json:"concurrency"`
PartSize int PartSize int `json:"part_size"`
} }
type OtherArgs struct { type OtherArgs struct {