Documentation
¶
Index ¶
- Constants
- Variables
- func ETag() bool
- func FirstLoadConcurrency() int
- func SetAtomicCacheDirectory(directory string) error
- func SetDeferredFileDirectory(directory string)
- func SetETag(b bool)
- func SetFirstLoadConcurrency(n int)
- type BundleFile
- type Fetcher
- func (f *Fetcher[V]) Close() error
- func (f *Fetcher[V]) Initial() (V, error)
- func (f *Fetcher[V]) LoadedContentHash() string
- func (f *Fetcher[V]) Name() string
- func (f *Fetcher[V]) Parse(buf []byte) (V, error)
- func (f *Fetcher[V]) ReadLoadedContent(read func(string, time.Time))
- func (f *Fetcher[V]) SetUpdatedAt(t time.Time)
- func (f *Fetcher[V]) SideUpdate(buf []byte) (V, bool, error)
- func (f *Fetcher[V]) Update() (V, bool, error)
- func (f *Fetcher[V]) UpdatedAt() time.Time
- func (f *Fetcher[V]) Vehicle() P.Vehicle
- func (f *Fetcher[V]) VehicleType() P.VehicleType
- type FileVehicle
- func (f *FileVehicle) Path() string
- func (f *FileVehicle) Proxy() string
- func (f *FileVehicle) Read(ctx context.Context, oldHash utils.HashType) (buf []byte, hash utils.HashType, err error)
- func (f *FileVehicle) Type() P.VehicleType
- func (f *FileVehicle) Url() string
- func (f *FileVehicle) Write(buf []byte) error
- type HTTPVehicle
- func (h *HTTPVehicle) Path() string
- func (h *HTTPVehicle) Proxy() string
- func (h *HTTPVehicle) Read(ctx context.Context, oldHash utils.HashType) (buf []byte, hash utils.HashType, err error)
- func (h *HTTPVehicle) SetInRead(fn func(response *http.Response))
- func (h *HTTPVehicle) Type() P.VehicleType
- func (h *HTTPVehicle) Url() string
- func (h *HTTPVehicle) Write(buf []byte) error
- type Parser
Constants ¶
View Source
const (
DefaultHttpTimeout = time.Second * 20
)
Variables ¶
View Source
var DefaultRemoteSizeLimit int64
View Source
var DeferRemoteInitialFetch bool
View Source
var ErrRemoteFetchDeferred = errors.New("remote fetch deferred to the background")
Functions ¶
func FirstLoadConcurrency ¶
func FirstLoadConcurrency() int
func SetAtomicCacheDirectory ¶
func SetDeferredFileDirectory ¶
func SetDeferredFileDirectory(directory string)
func SetFirstLoadConcurrency ¶
func SetFirstLoadConcurrency(n int)
Types ¶
type BundleFile ¶
type Fetcher ¶
type Fetcher[V any] struct { // contains filtered or unexported fields }
func NewFetcher ¶
func (*Fetcher[V]) LoadedContentHash ¶
func (*Fetcher[V]) ReadLoadedContent ¶
func (*Fetcher[V]) SetUpdatedAt ¶
func (*Fetcher[V]) VehicleType ¶
func (f *Fetcher[V]) VehicleType() P.VehicleType
type FileVehicle ¶
type FileVehicle struct {
// contains filtered or unexported fields
}
func NewFileVehicle ¶
func NewFileVehicle(path string) *FileVehicle
func (*FileVehicle) Path ¶
func (f *FileVehicle) Path() string
func (*FileVehicle) Proxy ¶
func (f *FileVehicle) Proxy() string
func (*FileVehicle) Type ¶
func (f *FileVehicle) Type() P.VehicleType
func (*FileVehicle) Url ¶
func (f *FileVehicle) Url() string
func (*FileVehicle) Write ¶
func (f *FileVehicle) Write(buf []byte) error
type HTTPVehicle ¶
type HTTPVehicle struct {
// contains filtered or unexported fields
}
func NewHTTPVehicle ¶
func (*HTTPVehicle) Path ¶
func (h *HTTPVehicle) Path() string
func (*HTTPVehicle) Proxy ¶
func (h *HTTPVehicle) Proxy() string
func (*HTTPVehicle) SetInRead ¶
func (h *HTTPVehicle) SetInRead(fn func(response *http.Response))
func (*HTTPVehicle) Type ¶
func (h *HTTPVehicle) Type() P.VehicleType
func (*HTTPVehicle) Url ¶
func (h *HTTPVehicle) Url() string
func (*HTTPVehicle) Write ¶
func (h *HTTPVehicle) Write(buf []byte) error
Click to show internal directories.
Click to hide internal directories.