Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Resource ¶
type Resource struct { io.ReadCloser // contains filtered or unexported fields }
The Resource class wraps a streamable file or remote Resource.
func NewResource ¶
Create a new Resource data stream. If relTo is specified and pathToResource does not define a scheme, then the path to the new Resource will be generated by concatenating the base path of relTo and pathToResource.
This function can handle http/https URLs by delegating to the net/http package. The caller must make sure to close the returned io.ReadCloser to prevent mem leaks.
func NewResourceFromStream ¶
Create a resource from a reader.
func (*Resource) RemotePath ¶
Return the remote path to this resource. If this is a remote resource then this method returns the base path (without leading /) of the remote URL. Otherwise, this method returns the same value as Path().