Documentation ¶
Overview ¶
Commands for reading and writing files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commands ¶
func (*Commands) Read ¶
func (self *Commands) Read(fileOrReader interface{}, args *ReadArgs) (*ReadResponse, error)
func (*Commands) Write ¶
func (self *Commands) Write(destination interface{}, args *WriteArgs) (*WriteResponse, error)
Write a value or a stream of data to a file at the given path. The destination path can be a local filesystem path, a URI that uses a custom scheme registered outside of the application, or the string "temporary", which will write to a temporary file whose path will be returned in the response.
type ReadResponse ¶ added in v0.8.0
type TempArgs ¶
type TempArgs struct { // A string to prefix temporary filenames with Prefix string `json:"prefix" default:"friendscript-"` }
type WriteArgs ¶
type WriteArgs struct { // The data to write to the destination. Data io.Reader `json:"data"` // The data to write as a discrete value. Value interface{} `json:"value"` // Whether to attempt to close the destination (if possible) after reading/writing. Autoclose bool `json:"autoclose" default:"true"` }
type WriteResponse ¶ added in v0.8.0
Click to show internal directories.
Click to hide internal directories.