Documentation
¶
Index ¶
- type Container
- func (c *Container) Create(args *CreateArgs) error
- func (c *Container) NetworkInfo(r RancherProvisioner) error
- func (c *Container) Remove(r RancherProvisioner) error
- func (c *Container) SetMileStone(state utils.State) error
- func (c *Container) SetStatus(status utils.Status) error
- func (c *Container) ShortId() string
- func (c *Container) Start(args *StartArgs) error
- func (c *Container) StateCheck(args RancherProvisioner) (err error)
- func (c *Container) Stop(p RancherProvisioner) error
- func (c *Container) UpdateContId() error
- type CreateArgs
- type NetworkInfo
- type RancherProvisioner
- type StartArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
Id string //container id.
BoxId string
AccountId string
CartonId string
Name string
BoxName string
Level provision.BoxLevel
PublicIp string
HostId string
HostAddr string
HostPort string
PrivateKey string
Client *client.RancherClient
Version string
Image string
Status utils.Status
State utils.State
BuildingImage string
LastStatusUpdate time.Time
LastSuccessStatusUpdate time.Time
LockedUntil time.Time
Routable bool
Region string
// contains filtered or unexported fields
}
func (*Container) Create ¶
func (c *Container) Create(args *CreateArgs) error
func (*Container) NetworkInfo ¶
func (c *Container) NetworkInfo(r RancherProvisioner) error
func (*Container) Remove ¶
func (c *Container) Remove(r RancherProvisioner) error
func (*Container) StateCheck ¶
func (c *Container) StateCheck(args RancherProvisioner) (err error)
func (*Container) Stop ¶
func (c *Container) Stop(p RancherProvisioner) error
func (*Container) UpdateContId ¶
type CreateArgs ¶
type CreateArgs struct {
ImageId string
Box *provision.Box
Deploy bool
Provisioner RancherProvisioner
DestinationHosts []string
}
func (c *Container) ShortId() string {
if len(c.Id) > 10 {
return c.Id[:10]
}
return c.Id
}
func (c *Container) Available() bool {
return c.Status.String() == constants.StatusContainerStarted.String() || c.Status.String() == constants.StatusContainerStarting.String()
}
func (c *Container) Address() *url.URL {
return &url.URL{
Scheme: "http",
Host: fmt.Sprintf("%s:%s", c.HostAddr, c.HostPort),
}
}
type NetworkInfo ¶
type RancherProvisioner ¶
Click to show internal directories.
Click to hide internal directories.