Documentation ¶
Index ¶
- Constants
- func ConfigDir() string
- func Connect(network, path string) (net.Conn, error)
- func ConnectAndWait(network, path string) (net.Conn, error)
- func ConvertImageToQCOW2(imagePath string) error
- func CopyFile(src, dst string) *exec.Cmd
- func CopyLocalFile(dst, src string) error
- func ExtendMap(m map[string]string, additional map[string]string)
- func FileInfoHeader() string
- func GenerateMAC() (net.HardwareAddr, error)
- func HomePath() string
- func ID() string
- func IsDirectIOSupported(path string) bool
- func IsRemoteImage(repo_url, name string) (bool, error)
- func IsRemotePackage(repo_url, name string) (bool, error)
- func ListImagesRemote(repo_url string, search string) error
- func ListPackagesRemote(repo_url string, search string) error
- func NeedsUpdate(localPkg, remotePkg *core.Package, compareCreated bool) (bool, error)
- func ParseEnvironmentList(envList []string) (map[string]string, error)
- func ParseMemSize(memory string) (int64, error)
- func RawTerm() error
- func RemotePackageInfo(repo_url string, path string) *core.Package
- func RemoveOrphanedInstances(verbose bool) error
- func ResetTerm()
- func ResizeImage(imagePath string, targetSize uint64) error
- func SearchInstance(name string) (instanceName, instancePlatform string)
- func SetCmdLine(imagePath string, cmdLine string) error
- func SetPartition(image string, partition int, start uint64, size uint64) error
- func StringInSlice(a string, list []string) bool
- func VersionStringToInt(version string) (int, error)
- type CapstanSettings
- type Contents
- type FileInfo
- type FilesInfo
- type ImageInfo
- type NbdFile
- func (file *NbdFile) Close() error
- func (file *NbdFile) Wait()
- func (file *NbdFile) Write(offset uint64, data []byte) error
- func (file *NbdFile) WriteByte(offset uint64, b byte) error
- func (file *NbdFile) WriteInt(offset uint64, i uint32) error
- func (file *NbdFile) WriteShort(offset uint64, s uint16) error
- type NbdReply
- type NbdRequest
- type NbdSession
- func (session *NbdSession) Disconnect() error
- func (session *NbdSession) Flush() error
- func (session *NbdSession) Handshake() error
- func (session *NbdSession) Read(offset uint64, length uint32) ([]byte, error)
- func (session *NbdSession) Recv() ([]byte, error)
- func (session *NbdSession) Write(from uint64, data []byte) error
- type Query
- type Repo
- func (r *Repo) DefaultImage() string
- func (r *Repo) DownloadImage(repo_url, hypervisor string, path string) error
- func (r *Repo) DownloadPackage(repo_url, packageName string) error
- func (r *Repo) GetPackage(pkgname string) (io.ReadSeeker, error)
- func (r *Repo) GetPackageDependencies(pkg core.Package, downloadMissing bool) ([]core.Package, error)
- func (r *Repo) GetPackageTarReader(pkgname string) (*tar.Reader, error)
- func (r *Repo) ImageCachePath(hypervisor string, image string) string
- func (r *Repo) ImageExists(hypervisor, image string) bool
- func (r *Repo) ImagePath(hypervisor string, image string) string
- func (r *Repo) ImportImage(imageName string, file string, version string, created string, ...) error
- func (r *Repo) ImportPackage(pkg core.Package, packagePath string) error
- func (r *Repo) InitializeImage(loaderImage string, imageName string, imageSize int64) error
- func (r *Repo) ListImages() string
- func (r *Repo) ListPackages() string
- func (r *Repo) LocalPackages(search string) ([]*core.Package, error)
- func (r *Repo) PackageExists(packageName string) bool
- func (r *Repo) PackageManifest(packageName string) string
- func (r *Repo) PackagePath(packageName string) string
- func (r *Repo) PackagesPath() string
- func (r *Repo) PrintRepo()
- func (r *Repo) PullImage(image string) error
- func (r *Repo) RemoveImage(image string) error
- func (r *Repo) RepoPath() string
Constants ¶
const ( NBD_REQUEST_MAGIC = 0x25609513 NBD_REPLY_MAGIC = 0x67446698 )
const ( NBD_CMD_READ = 0 NBD_CMD_WRITE = 1 NBD_CMD_DISC = 2 NBD_CMD_FLUSH = 3 NBD_CMD_TRIM = 4 )
const ( NBD_FLAG_HAS_FLAGS = (1 << 0) NBD_FLAG_SEND_FLUSH = (1 << 2) )
const (
DefaultRepositoryUrl = "https://mikelangelo-capstan.s3.amazonaws.com/"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertImageToQCOW2 ¶ added in v0.2.0
func CopyLocalFile ¶ added in v0.2.0
func FileInfoHeader ¶
func FileInfoHeader() string
func GenerateMAC ¶ added in v0.1.3
func GenerateMAC() (net.HardwareAddr, error)
Generate a MAC address.
func IsDirectIOSupported ¶ added in v0.1.3
func IsRemoteImage ¶
func IsRemotePackage ¶ added in v0.2.0
IsRemotePackage checks that the given package is available in the remote repository. In order to confirm the package really exists, both manifest and the actual package content must exist in remote repository.
func ListImagesRemote ¶
func ListPackagesRemote ¶ added in v0.2.0
func NeedsUpdate ¶ added in v0.3.0
func ParseEnvironmentList ¶ added in v0.2.1
func ParseMemSize ¶
func RemotePackageInfo ¶ added in v0.2.0
RemotePackageInfo downloads the given manifest files and tries to parse it. core.Package struct is returned if it succeeds, otherwise nil.
func RemoveOrphanedInstances ¶ added in v0.2.0
RemoveOrphanedInstances removes directories of instances that were not persisted with --persist.
func ResizeImage ¶ added in v0.2.0
func SearchInstance ¶
func SetCmdLine ¶ added in v0.2.0
func SetPartition ¶ added in v0.2.0
func StringInSlice ¶ added in v0.3.0
func VersionStringToInt ¶ added in v0.3.0
VersionStringToInt converts 1.2.3 into 1002003 to make it comparable.
Types ¶
type CapstanSettings ¶ added in v0.2.0
type FileInfo ¶
type FileInfo struct { Namespace string Name string Description string Version string Created core.YamlTime `yaml:"created"` Platform string }
func ParseIndexYaml ¶ added in v0.3.0
func RemoteFileInfo ¶
type NbdFile ¶ added in v0.2.0
type NbdFile struct { Cmd *exec.Cmd Session *NbdSession }
func NewNbdFile ¶ added in v0.2.0
type NbdRequest ¶ added in v0.2.0
func (*NbdRequest) ToWireFormat ¶ added in v0.2.0
func (msg *NbdRequest) ToWireFormat() []byte
type NbdSession ¶ added in v0.2.0
func (*NbdSession) Disconnect ¶ added in v0.2.0
func (session *NbdSession) Disconnect() error
func (*NbdSession) Flush ¶ added in v0.2.0
func (session *NbdSession) Flush() error
func (*NbdSession) Handshake ¶ added in v0.2.0
func (session *NbdSession) Handshake() error
func (*NbdSession) Read ¶ added in v0.2.0
func (session *NbdSession) Read(offset uint64, length uint32) ([]byte, error)
func (*NbdSession) Recv ¶ added in v0.2.0
func (session *NbdSession) Recv() ([]byte, error)
type Repo ¶
func (*Repo) DefaultImage ¶
func (*Repo) DownloadImage ¶
func (*Repo) DownloadPackage ¶ added in v0.2.0
DownloadPackage downloads a package from the S3 repository into local.
func (*Repo) GetPackage ¶ added in v0.2.0
func (r *Repo) GetPackage(pkgname string) (io.ReadSeeker, error)
func (*Repo) GetPackageDependencies ¶ added in v0.2.0
func (*Repo) GetPackageTarReader ¶ added in v0.3.0
GetPackageTarReader returns tar reader for package with given name.
func (*Repo) ImageCachePath ¶ added in v0.2.0
func (*Repo) ImageExists ¶
func (*Repo) ImportImage ¶ added in v0.1.3
func (*Repo) ImportPackage ¶ added in v0.2.0
func (*Repo) InitializeImage ¶ added in v0.2.0
func (*Repo) ListImages ¶
func (*Repo) ListPackages ¶ added in v0.2.0
func (*Repo) LocalPackages ¶ added in v0.3.0
func (*Repo) PackageExists ¶ added in v0.2.0
PackageExists will check that both package manifest and package file are present in the local package repository.