mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-04-06 02:58:38 +00:00
This uses the Packet.net API and iPXE to boot a Moby host. There are several enhancements coming soon, such as SSH key customisation, but this PR is sufficient to boot a host and then use the web interface to get console access. The user must currently upload the built artefacts to a public URL and specify it via --base-url, e.g.: moby run packet --api-key <key> --project-id <id> \ --base-url http://recoil.org/~avsm/ipxe --hostname test-moby packet See #1424 #1245 for related issues. Signed-off-by: Anil Madhavapeddy <anil@docker.com>
42 lines
879 B
Go
42 lines
879 B
Go
package packngo
|
|
|
|
const emailBasePath = "/emails"
|
|
|
|
// EmailService interface defines available email methods
|
|
type EmailService interface {
|
|
Get(string) (*Email, *Response, error)
|
|
}
|
|
|
|
// Email represents a user's email address
|
|
type Email struct {
|
|
ID string `json:"id"`
|
|
Address string `json:"address"`
|
|
Default bool `json:"default,omitempty"`
|
|
URL string `json:"href,omitempty"`
|
|
}
|
|
|
|
func (e Email) String() string {
|
|
return Stringify(e)
|
|
}
|
|
|
|
// EmailServiceOp implements EmailService
|
|
type EmailServiceOp struct {
|
|
client *Client
|
|
}
|
|
|
|
// Get retrieves an email by id
|
|
func (s *EmailServiceOp) Get(emailID string) (*Email, *Response, error) {
|
|
req, err := s.client.NewRequest("GET", emailBasePath, nil)
|
|
if err != nil {
|
|
return nil, nil, err
|
|
}
|
|
|
|
email := new(Email)
|
|
resp, err := s.client.Do(req, email)
|
|
if err != nil {
|
|
return nil, resp, err
|
|
}
|
|
|
|
return email, resp, err
|
|
}
|