Documentation
¶
Index ¶
- func CopyImage(dest, endpoint, accessKey, secKey string) error
- func ParseEndpoint(endpt string) (*url.URL, error)
- func ParseEnvVar(envVarName string, decode bool) (string, error)
- func SaveStream(stream io.ReadCloser, dest string) (int64, error)
- func StreamDataToFile(dataReader io.Reader, filePath string) error
- type DataStream
- type DataStreamInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyImage ¶
CopyImage copies the source endpoint (vm image) to the provided destination path.
func ParseEndpoint ¶
ParseEndpoint parses the required endpoint and return the url struct.
func ParseEnvVar ¶
ParseEnvVar provides a wrapper to attempt to fetch the specified env var
Types ¶
type DataStream ¶
type DataStream struct {
Readers []reader
Size int64
// contains filtered or unexported fields
}
DataStream implements the ReadCloser interface
func NewDataStream ¶
func NewDataStream(endpt, accKey, secKey string) (*DataStream, error)
NewDataStream returns a DataStream object after validating the endpoint and constructing the reader/closer chain. Note: the caller must close the `Readers` in reverse order. See Close().
func (*DataStream) Read ¶
func (d *DataStream) Read(buf []byte) (int, error)
Read from top-most reader. Note: ReadFull is needed since there may be intermediate, smaller multi-readers in the reader stack, and we need to be able to fill buf.
Source Files
¶
- dataStream.go
- util.go
Click to show internal directories.
Click to hide internal directories.