rancher

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2015 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LB_IMAGE       = "rancher/load-balancer-service"
	DNS_IMAGE      = "rancher/dns-service"
	EXTERNAL_IMAGE = "rancher/external-service"

	RancherType         = ServiceType(iota)
	LbServiceType       = ServiceType(iota)
	DnsServiceType      = ServiceType(iota)
	ExternalServiceType = ServiceType(iota)
)

Variables

This section is empty.

Functions

func NewProject

func NewProject(context *Context) (*project.Project, error)

func ResolveRancherCompose added in v0.5.0

func ResolveRancherCompose(composeFile, rancherComposeFile string) (string, error)

func Upload

func Upload(c *Context, name string) (string, string, error)

Types

type CompositeService added in v0.5.0

type CompositeService struct {
	rancherClient.Service

	//LoadBalancer Fields
	CertificateIds       []string                          `json:"certificateIds,omitempty" yaml:"certificate_ids,omitempty"`
	DefaultCertificateId string                            `json:"defaultCertificateId,omitempty" yaml:"default_certificate_id,omitempty"`
	LoadBalancerConfig   *rancherClient.LoadBalancerConfig `json:"loadBalancerConfig,omitempty" yaml:"load_balancer_config,omitempty"`

	// External Service Fields
	ExternalIpAddresses []string                           `json:"externalIpAddresses,omitempty" yaml:"external_ip_addresses,omitempty"`
	Hostname            string                             `json:"hostname,omitempty" yaml:"hostname,omitempty"`
	HealthCheck         *rancherClient.InstanceHealthCheck `json:"healthCheck,omitempty" yaml:"health_check,omitempty"`
}

type Container added in v0.2.0

type Container struct {
	// contains filtered or unexported fields
}

func NewContainer added in v0.2.0

func NewContainer(id, name string) *Container

func (*Container) ID added in v0.4.1

func (c *Container) ID() (string, error)

func (*Container) Name added in v0.2.0

func (c *Container) Name() string

func (*Container) Port added in v0.2.3

func (c *Container) Port(port string) (string, error)

type ContainerInspect

type ContainerInspect struct {
	Name       string
	Config     *runconfig.Config
	HostConfig *runconfig.HostConfig
}

type Context

type Context struct {
	project.Context

	RancherConfig       map[string]RancherConfig
	RancherComposeFile  string
	RancherComposeBytes []byte
	Url                 string
	AccessKey           string
	SecretKey           string
	Client              *rancherClient.RancherClient
	Environment         *rancherClient.Environment

	SidekickInfo *SidekickInfo
	Uploader     Uploader
	PullCached   bool
	Pull         bool

	Upgrade        bool
	ForceUpgrade   bool
	Rollback       bool
	Interval       int64
	BatchSize      int64
	ConfirmUpgrade bool
	// contains filtered or unexported fields
}

func (*Context) LoadEnv added in v0.5.0

func (c *Context) LoadEnv() (*rancherClient.Environment, error)

func (*Context) Uuid added in v0.5.0

func (c *Context) Uuid() string

type Factory added in v0.5.0

type Factory interface {
	Hash(service *RancherService) (digest.ServiceHash, error)
	Create(service *RancherService) error
	Upgrade(r *RancherService, force bool) error
	Rollback(r *RancherService) error
}

func GetFactory added in v0.5.0

func GetFactory(service *RancherService) (Factory, error)

type IsDone

type IsDone func(*rancherClient.Resource) (bool, error)
type Link struct {
	ServiceName, Alias string
}

type NormalFactory added in v0.5.0

type NormalFactory struct {
}

func (*NormalFactory) Create added in v0.5.0

func (f *NormalFactory) Create(r *RancherService) error

func (*NormalFactory) Hash added in v0.5.0

func (f *NormalFactory) Hash(service *RancherService) (digest.ServiceHash, error)

func (*NormalFactory) Rollback added in v0.5.0

func (f *NormalFactory) Rollback(r *RancherService) error

func (*NormalFactory) Upgrade added in v0.5.0

func (f *NormalFactory) Upgrade(r *RancherService, force bool) error

type RancherConfig

type RancherConfig struct {
	Scale              int                                `yaml:"scale,omitempty"`
	LoadBalancerConfig *rancherClient.LoadBalancerConfig  `yaml:"load_balancer_config,omitempty"`
	ExternalIps        []string                           `yaml:"external_ips,omitempty"`
	Hostname           string                             `yaml:"hostname,omitempty"`
	HealthCheck        *rancherClient.InstanceHealthCheck `yaml:"health_check,omitempty"`
	DefaultCert        string                             `yaml:"default_cert,omitempty"`
	Certs              []string                           `yaml:"certs,omitempty"`
	Metadata           map[string]interface{}             `yaml:"metadata,omitempty"`
	Uuid               string                             `yaml:"uuid,omitempty"`
}

type RancherService

type RancherService struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(name string, config *project.ServiceConfig, context *Context) *RancherService

func (*RancherService) Build added in v0.2.2

func (r *RancherService) Build() error

func (*RancherService) Client added in v0.2.2

func (*RancherService) Config

func (r *RancherService) Config() *project.ServiceConfig

func (*RancherService) Containers added in v0.2.0

func (r *RancherService) Containers() ([]project.Container, error)

func (*RancherService) Context added in v0.5.0

func (r *RancherService) Context() *Context

func (*RancherService) Create

func (r *RancherService) Create() error

func (*RancherService) Delete

func (r *RancherService) Delete() error

func (*RancherService) DependentServices added in v0.2.0

func (r *RancherService) DependentServices() []project.ServiceRelationship

func (*RancherService) Down

func (r *RancherService) Down() error

func (*RancherService) FindExisting added in v0.5.0

func (r *RancherService) FindExisting(name string) (*rancherClient.Service, error)

func (*RancherService) HealthCheck added in v0.5.0

func (*RancherService) Info added in v0.2.3

func (r *RancherService) Info() (project.InfoSet, error)

func (*RancherService) Kill added in v0.2.2

func (r *RancherService) Kill() error

func (*RancherService) Log

func (r *RancherService) Log() error

func (*RancherService) Metadata added in v0.5.0

func (r *RancherService) Metadata() map[string]interface{}

func (*RancherService) Name

func (r *RancherService) Name() string

func (*RancherService) Pull added in v0.2.0

func (r *RancherService) Pull() (err error)

func (*RancherService) RancherConfig added in v0.5.0

func (r *RancherService) RancherConfig() RancherConfig

func (*RancherService) RancherService added in v0.2.2

func (r *RancherService) RancherService() (*rancherClient.Service, error)

func (*RancherService) Restart

func (r *RancherService) Restart() error

func (*RancherService) Scale

func (r *RancherService) Scale(count int) error

func (*RancherService) SelectorContainer added in v0.5.0

func (r *RancherService) SelectorContainer() string
func (r *RancherService) SelectorLink() string

func (*RancherService) Start added in v0.2.2

func (r *RancherService) Start() error

func (*RancherService) Up

func (r *RancherService) Up() error

func (*RancherService) Wait added in v0.2.2

func (r *RancherService) Wait(service *rancherClient.Service) error

func (*RancherService) WaitFor added in v0.4.0

func (r *RancherService) WaitFor(resource *rancherClient.Resource, output interface{}, transitioning func() string) error

type RancherServiceFactory

type RancherServiceFactory struct {
	Context *Context
}

func (*RancherServiceFactory) Create

func (r *RancherServiceFactory) Create(project *project.Project, name string, serviceConfig *project.ServiceConfig) (project.Service, error)

type S3Uploader

type S3Uploader struct {
}

func (*S3Uploader) Name

func (s *S3Uploader) Name() string

func (*S3Uploader) Upload

func (s *S3Uploader) Upload(p *project.Project, name string, reader io.ReadSeeker, hash string) (string, string, error)

type ServiceType added in v0.5.0

type ServiceType int

func FindServiceType added in v0.5.0

func FindServiceType(r *RancherService) ServiceType

type Sidekick

type Sidekick struct {
	project.EmptyService
	// contains filtered or unexported fields
}

func NewSidekick

func NewSidekick(name string, serviceConfig *project.ServiceConfig, context *Context) *Sidekick

func (*Sidekick) Config

func (s *Sidekick) Config() *project.ServiceConfig

func (*Sidekick) DependentServices added in v0.2.0

func (s *Sidekick) DependentServices() []project.ServiceRelationship

func (*Sidekick) Log

func (s *Sidekick) Log() error

func (*Sidekick) Name

func (s *Sidekick) Name() string

type SidekickInfo

type SidekickInfo struct {
	// contains filtered or unexported fields
}

func NewSidekickInfo

func NewSidekickInfo(project *project.Project) *SidekickInfo

type Uploader

type Uploader interface {
	Upload(p *project.Project, name string, reader io.ReadSeeker, hash string) (string, string, error)
	Name() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL