Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DockerHubRequest ¶
type DockerHubRequest struct { CallbackURL string `json:"callback_url"` PushData *PushData `json:"push_data"` Repository *Repository `json:"repository"` }
DockerHubRequest mimics DockerHub's request.
type InServiceStrategy ¶
type InServiceStrategy struct {
LaunchConfig *LaunchConfig `json:"launchConfig"`
}
InServiceStrategy mimics Rancher's InServiceStrategy JSON response.
type LaunchConfig ¶
type LaunchConfig struct { ImageUUID string `json:"imageUuid"` Kind string `json:"kind"` Ports []string `json:"ports"` Labels map[string]string `json:"labels"` Environment map[string]string `json:"environment"` }
LaunchConfig mimics Rancher's LaunchConfig JSON response.
type RancherAPI ¶
type RancherAPI struct {
Address, Host, APIKey, APISecret, ProjectID, DockerHubKey string
Port int
Services map[string]*Service
LoadBalancers map[string]*Service
}
RancherAPI is the main struct
func (*RancherAPI) FinishUpgradeService ¶
func (ra *RancherAPI) FinishUpgradeService(s *Service) bool
FinishUpgradeService calls Rancher's JSON API with the `finishupgrade` action.
func (*RancherAPI) LoadServices ¶
func (ra *RancherAPI) LoadServices()
LoadServices calls Rancher's JSON API for all the services.
func (*RancherAPI) RefreshService ¶
func (ra *RancherAPI) RefreshService(s *Service)
RefreshService does a GET to Rancher's JSON API for that specific `Service`
func (*RancherAPI) Run ¶
func (ra *RancherAPI) Run()
Run starts the callback HTTP server and listens on `BindAddress:BindPort`
func (*RancherAPI) UpgradeService ¶
func (ra *RancherAPI) UpgradeService(s *Service)
UpgradeService calls Rancher's JSON API with the `upgrade` action.
type Repository ¶
Repository mimics DockerHub's JSON model.
type Response ¶
type Response struct {
Data []*Service
}
Response mimics Rancher's Services JSON response.
type Service ¶
type Service struct {
ID, Kind, Type, Name, State, AccountID, FQDN string
LaunchConfig *LaunchConfig
Actions map[string]string
}
Service mimics Rancher's Service JSON response.
type Strategy ¶
type Strategy struct { InServiceStrategy *InServiceStrategy `json:"inServiceStrategy"` ToServiceStrategy *InServiceStrategy `json:"toServiceStrategy"` }
Strategy mimics Rancher's Strategy JSON response.