Documentation
¶
Index ¶
- Variables
- func Open(fn string) (io.ReadCloser, error)
- func OpenContext(ctx context.Context, fn string) (io.ReadCloser, error)
- func OpenURL(u *url.URL) (io.ReadCloser, error)
- func OpenURLContext(ctx context.Context, u *url.URL) (io.ReadCloser, error)
- func Stat(fn string) (fs.FileInfo, error)
- func StatContext(ctx context.Context, fn string) (fs.FileInfo, error)
- func StatURL(u *url.URL) (fs.FileInfo, error)
- func StatURLContext(ctx context.Context, u *url.URL) (fs.FileInfo, error)
- type Client
- func (c *Client) Open(fn string) (io.ReadCloser, error)
- func (c *Client) OpenContext(ctx context.Context, fn string) (io.ReadCloser, error)
- func (c *Client) OpenURL(u *url.URL) (io.ReadCloser, error)
- func (c *Client) OpenURLContext(ctx context.Context, u *url.URL) (io.ReadCloser, error)
- func (c *Client) Stat(fn string) (fs.FileInfo, error)
- func (c *Client) StatContext(ctx context.Context, fn string) (fs.FileInfo, error)
- func (c *Client) StatURL(u *url.URL) (fs.FileInfo, error)
- func (c *Client) StatURLContext(ctx context.Context, u *url.URL) (fs.FileInfo, error)
- type Handler
- type HttpProtocol
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultClient = &Client{} AllowLocal = &Client{AllowLocal: true} )
View Source
var ( ErrNotAbsolute = errors.New("Provided URL is not absolute") ErrProtocolNotSupported = errors.New("requested protocol is not supported") ErrLocalInvalidHost = errors.New("invalid file: hostname provided") )
View Source
var Data = &dataProtocol{}
View Source
var Http = &HttpProtocol{Client: http.DefaultClient}
View Source
var Local = &localProtocol{}
Functions ¶
func OpenContext ¶
func OpenURLContext ¶
func StatContext ¶ added in v0.1.1
Types ¶
type Client ¶
type Client struct {
AllowLocal bool // if false, file:// and local access will be disabled. If true, even removing the file:// protocol will still allow direct file opening
}
func (*Client) OpenContext ¶
func (*Client) OpenURLContext ¶
func (*Client) StatContext ¶ added in v0.1.1
type HttpProtocol ¶
Click to show internal directories.
Click to hide internal directories.