Documentation ¶
Index ¶
- type Machine
- type MachineURLOpener
- type URLMux
- func (mux *URLMux) MachineSchemes() []string
- func (mux *URLMux) New(ctx context.Context, urlstr string) (*Machine, error)
- func (mux *URLMux) NewURL(ctx context.Context, u *url.URL) (*Machine, error)
- func (mux *URLMux) RegisterMachine(scheme string, opener MachineURLOpener)
- func (mux *URLMux) ValidMachineScheme(scheme string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine provides an easy and portable way to interact with vms
func New ¶
New opens the Machine identified by the URL given.
See the URLOpener documentation in driver subpackages for details on supported URL formats, and https://gocloud.dev/concepts/urls/ for more information.
func (*Machine) As ¶
As converts i to driver-specific types. See https://gocloud.dev/concepts/as/ for background information, the "As" examples in this package for examples, and the driver package documentation for the specific types supported for that driver.
func (*Machine) ErrorAs ¶
ErrorAs converts err to driver-specific types. ErrorAs panics if i is nil or not a pointer. ErrorAs returns false if err == nil. See https://gocloud.dev/concepts/as/ for background information.
type MachineURLOpener ¶
MachineURLOpener represents types that can open Machines based on a URL. The opener must not modify the URL argument. NewURL must be safe to call from multiple goroutines.
This interface is generally implemented by types in driver packages.
type URLMux ¶
type URLMux struct {
// contains filtered or unexported fields
}
URLMux is a URL opener multiplexer. It matches the scheme of the URLs against a set of registered schemes and calls the opener that matches the URL's scheme. See https://gocloud.dev/concepts/urls/ for more information.
The zero value is a multiplexer with no registered schemes.
func DefaultURLMux ¶
func DefaultURLMux() *URLMux
DefaultURLMux returns the URLMux used by New.
Driver packages can use this to register their MachineURLOpener on the mux.
func (*URLMux) MachineSchemes ¶
MachineSchemes returns a sorted slice of the registered Machine schemes.
func (*URLMux) New ¶
New calls NewURL with the URL parsed from urlstr. New is safe to call from multiple goroutines.
func (*URLMux) NewURL ¶
NewURL dispatches the URL to the opener that is registered with the URL's scheme. NewURL is safe to call from multiple goroutines.
func (*URLMux) RegisterMachine ¶
func (mux *URLMux) RegisterMachine(scheme string, opener MachineURLOpener)
RegisterMachine registers the opener with the given scheme. If an opener already exists for the scheme, RegisterMachine panics.
func (*URLMux) ValidMachineScheme ¶
ValidMachineScheme returns true iff scheme has been registered for Machines.