Documentation ¶
Index ¶
- Variables
- func Get(ctx context.Context, engine Engine, u *URI) ([]byte, error)
- func NewBytesReader(b []byte) *bytesReader
- func Put(ctx context.Context, engine Engine, u *URI, r io.Reader) error
- func Size(r Reader) (int64, error)
- type Engine
- type FileSystem
- func (f *FileSystem) Delete(_ context.Context, u *URI) error
- func (f *FileSystem) DeleteByPrefix(_ context.Context, u *URI) error
- func (f *FileSystem) Exists(_ context.Context, u *URI) (bool, error)
- func (f *FileSystem) Get(ctx context.Context, u *URI) (Reader, error)
- func (f *FileSystem) List(ctx context.Context, u *URI) ([]Info, error)
- func (f *FileSystem) Put(_ context.Context, u *URI) (io.WriteCloser, error)
- func (f *FileSystem) PutIfNotExists(_ context.Context, u *URI, b []byte) error
- func (f *FileSystem) Size(_ context.Context, u *URI) (int64, error)
- type HTTPEngine
- func (*HTTPEngine) Delete(_ context.Context, u *URI) error
- func (*HTTPEngine) DeleteByPrefix(_ context.Context, u *URI) error
- func (*HTTPEngine) Exists(_ context.Context, u *URI) (bool, error)
- func (*HTTPEngine) Get(ctx context.Context, u *URI) (Reader, error)
- func (*HTTPEngine) List(ctx context.Context, u *URI) ([]Info, error)
- func (*HTTPEngine) Put(_ context.Context, u *URI) (io.WriteCloser, error)
- func (*HTTPEngine) PutIfNotExists(context.Context, *URI, []byte) error
- func (*HTTPEngine) Size(_ context.Context, u *URI) (int64, error)
- type Info
- type NopCloser
- type Reader
- type Router
- func (r *Router) Delete(ctx context.Context, u *URI) error
- func (r *Router) DeleteByPrefix(ctx context.Context, u *URI) error
- func (r *Router) Enable(scheme Scheme)
- func (r *Router) Exists(ctx context.Context, u *URI) (bool, error)
- func (r *Router) Get(ctx context.Context, u *URI) (Reader, error)
- func (r *Router) List(ctx context.Context, u *URI) ([]Info, error)
- func (r *Router) Put(ctx context.Context, u *URI) (io.WriteCloser, error)
- func (r *Router) PutIfNotExists(ctx context.Context, u *URI, b []byte) error
- func (r *Router) Size(ctx context.Context, u *URI) (int64, error)
- type S3Engine
- func (s *S3Engine) Delete(ctx context.Context, u *URI) error
- func (s *S3Engine) DeleteByPrefix(ctx context.Context, u *URI) error
- func (s *S3Engine) Exists(ctx context.Context, u *URI) (bool, error)
- func (s *S3Engine) Get(ctx context.Context, u *URI) (Reader, error)
- func (s *S3Engine) List(ctx context.Context, uri *URI) ([]Info, error)
- func (s *S3Engine) Put(ctx context.Context, u *URI) (io.WriteCloser, error)
- func (s *S3Engine) PutIfNotExists(context.Context, *URI, []byte) error
- func (s *S3Engine) Size(ctx context.Context, u *URI) (int64, error)
- type Scheme
- type Seeker
- type Sizer
- type StdioEngine
- func (*StdioEngine) Delete(ctx context.Context, u *URI) error
- func (*StdioEngine) DeleteByPrefix(ctx context.Context, u *URI) error
- func (*StdioEngine) Exists(_ context.Context, u *URI) (bool, error)
- func (*StdioEngine) Get(_ context.Context, u *URI) (Reader, error)
- func (*StdioEngine) List(_ context.Context, _ *URI) ([]Info, error)
- func (*StdioEngine) Put(ctx context.Context, u *URI) (io.WriteCloser, error)
- func (*StdioEngine) PutIfNotExists(context.Context, *URI, []byte) error
- func (*StdioEngine) Size(_ context.Context, u *URI) (int64, error)
- type URI
- func (p *URI) AppendPath(elem ...string) *URI
- func (p *URI) Filepath() string
- func (u *URI) HasScheme(s Scheme) bool
- func (u *URI) IsZero() bool
- func (u *URI) MarshalText() ([]byte, error)
- func (u *URI) MarshalZNG(mc *zson.MarshalZNGContext) (zed.Type, error)
- func (u *URI) RelPath(target URI) string
- func (u URI) String() string
- func (u *URI) UnmarshalText(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ErrNotSupported = errors.New("method call on storage engine not supported")
Functions ¶
func NewBytesReader ¶
func NewBytesReader(b []byte) *bytesReader
Types ¶
type Engine ¶
type Engine interface { Get(context.Context, *URI) (Reader, error) Put(context.Context, *URI) (io.WriteCloser, error) PutIfNotExists(context.Context, *URI, []byte) error Delete(context.Context, *URI) error DeleteByPrefix(context.Context, *URI) error Exists(context.Context, *URI) (bool, error) Size(context.Context, *URI) (int64, error) List(context.Context, *URI) ([]Info, error) }
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem() *FileSystem
func (*FileSystem) DeleteByPrefix ¶
func (f *FileSystem) DeleteByPrefix(_ context.Context, u *URI) error
func (*FileSystem) Put ¶
func (f *FileSystem) Put(_ context.Context, u *URI) (io.WriteCloser, error)
func (*FileSystem) PutIfNotExists ¶
type HTTPEngine ¶
type HTTPEngine struct{}
func NewHTTP ¶
func NewHTTP() *HTTPEngine
func (*HTTPEngine) DeleteByPrefix ¶
func (*HTTPEngine) DeleteByPrefix(_ context.Context, u *URI) error
func (*HTTPEngine) Put ¶
func (*HTTPEngine) Put(_ context.Context, u *URI) (io.WriteCloser, error)
func (*HTTPEngine) PutIfNotExists ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is an Engine that routes each function call to the correct sub-Engine based off the provided URI's scheme and its enablement.
func NewLocalEngine ¶
func NewLocalEngine() *Router
func NewRemoteEngine ¶
func NewRemoteEngine() *Router
func (*Router) PutIfNotExists ¶
type S3Engine ¶
type S3Engine struct {
// contains filtered or unexported fields
}
func (*S3Engine) DeleteByPrefix ¶
func (*S3Engine) PutIfNotExists ¶
type Seeker ¶
type Seeker struct { io.ReadSeeker Reader }
func NewSeeker ¶
NewSeeker provides a seeker implementation on top of Reader. Using a seeker is not optimal as cloud-oriented apps should use application-level framing to do readahead and so forth based that leverages knowledge of the data of the underlying storage objects. This seeker interface is provided for backward compat with libraries like parquet-go that are based on an io.ReadSeeker.
type StdioEngine ¶
type StdioEngine struct{}
func NewStdioEngine ¶
func NewStdioEngine() *StdioEngine
func (*StdioEngine) DeleteByPrefix ¶
func (*StdioEngine) DeleteByPrefix(ctx context.Context, u *URI) error
func (*StdioEngine) Put ¶
func (*StdioEngine) Put(ctx context.Context, u *URI) (io.WriteCloser, error)
func (*StdioEngine) PutIfNotExists ¶
type URI ¶
func MustParseURI ¶
func ParseURI ¶
ParseURI parses the path using `url.Parse`. If the provided uri does not contain a scheme, the scheme is set to file. Relative paths are treated as files and resolved as absolute paths using filepath.Abs. If path is an empty, a pointer to zero-valued URI is returned.
func (*URI) AppendPath ¶
func (*URI) MarshalText ¶
func (*URI) MarshalZNG ¶
func (*URI) UnmarshalText ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cache contains facilities for caching immutable files, typically for a cloud object store.
|
Package cache contains facilities for caching immutable files, typically for a cloud object store. |
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |