Documentation ¶
Index ¶
- Constants
- type Config
- type Configurer
- type DB
- type EventReadWriter
- func (rw EventReadWriter) AllEvents(before time.Time, limit int64) ([]flux.Event, error)
- func (rw EventReadWriter) EventsForService(service flux.ServiceID, before time.Time, limit int64) ([]flux.Event, error)
- func (rw EventReadWriter) GetEvent(id flux.EventID) (flux.Event, error)
- func (rw EventReadWriter) LogEvent(e flux.Event) error
- type ImageMap
- type Instance
- func (h *Instance) CollectAvailableImages(services []platform.Service) (ImageMap, error)
- func (h *Instance) ConfigRepo() git.Repo
- func (h *Instance) ExactImages(images []flux.ImageID) (ImageMap, error)
- func (h *Instance) Export() ([]byte, error)
- func (h *Instance) GetAllServices(maybeNamespace string) ([]platform.Service, error)
- func (h *Instance) GetAllServicesExcept(maybeNamespace string, ignored flux.ServiceIDSet) (res []platform.Service, err error)
- func (h *Instance) GetConfig() (Config, error)
- func (h *Instance) GetRepository(repo string) (res []flux.ImageDescription, err error)
- func (h *Instance) GetServices(ids []flux.ServiceID) ([]platform.Service, error)
- func (h *Instance) Ping() error
- func (h *Instance) PlatformApply(defs []platform.ServiceDefinition) (err error)
- func (h *Instance) UpdateConfig(update UpdateFunc) error
- func (h *Instance) Version() (string, error)
- type Instancer
- type MockConfigurer
- type MockInstancer
- type MultitenantInstancer
- type NamedConfig
- type ServiceConfig
- type StandaloneInstancer
- type UpdateFunc
Constants ¶
const ( LabelMethod = "method" LabelSuccess = "success" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Services map[flux.ServiceID]ServiceConfig `json:"services"` Settings flux.UnsafeInstanceConfig `json:"settings"` }
func MakeConfig ¶
func MakeConfig() Config
type Configurer ¶
type Configurer interface { Get() (Config, error) Update(UpdateFunc) error }
type DB ¶
type DB interface { UpdateConfig(instance flux.InstanceID, update UpdateFunc) error GetConfig(instance flux.InstanceID) (Config, error) All() ([]NamedConfig, error) }
func InstrumentedDB ¶
type EventReadWriter ¶
type EventReadWriter struct {
// contains filtered or unexported fields
}
func (EventReadWriter) EventsForService ¶
type ImageMap ¶
type ImageMap map[string][]flux.ImageDescription
func (ImageMap) LatestImage ¶
func (m ImageMap) LatestImage(repo string) *flux.ImageDescription
LatestImage returns the latest releasable image for a repository. A releasable image is one that is not tagged "latest". (Assumes the available images are in descending order of latestness.) If no such image exists, returns nil, and the caller can decide whether that's an error or not.
type Instance ¶
type Instance struct { Platform platform.Platform Registry registry.Registry Config Configurer Repo git.Repo log.Logger history.EventReader history.EventWriter }
func New ¶
func New( platform platform.Platform, registry registry.Registry, config Configurer, gitrepo git.Repo, logger log.Logger, events history.EventReader, eventlog history.EventWriter, ) *Instance
func (*Instance) CollectAvailableImages ¶
Get the images available for the services given. An image may be mentioned more than once in the services, but will only be fetched once.
func (*Instance) ConfigRepo ¶
func (*Instance) ExactImages ¶
Create a map of images. It will check that each image exists.
func (*Instance) GetAllServices ¶
Get the services in `namespace` along with their containers (if there are any) from the platform; if namespace is blank, just get all the services, in any namespace.
func (*Instance) GetAllServicesExcept ¶
func (h *Instance) GetAllServicesExcept(maybeNamespace string, ignored flux.ServiceIDSet) (res []platform.Service, err error)
Get all services except those with an ID in the set given
func (*Instance) GetRepository ¶
func (h *Instance) GetRepository(repo string) (res []flux.ImageDescription, err error)
GetRepository exposes this instance's registry's GetRepository method directly.
func (*Instance) GetServices ¶
Get the services mentioned, along with their containers.
func (*Instance) PlatformApply ¶
func (h *Instance) PlatformApply(defs []platform.ServiceDefinition) (err error)
func (*Instance) UpdateConfig ¶
func (h *Instance) UpdateConfig(update UpdateFunc) error
type MockConfigurer ¶
func (*MockConfigurer) Get ¶
func (c *MockConfigurer) Get() (Config, error)
func (*MockConfigurer) Update ¶
func (c *MockConfigurer) Update(up UpdateFunc) error
type MockInstancer ¶
func (*MockInstancer) Get ¶
func (m *MockInstancer) Get(_ flux.InstanceID) (*Instance, error)
type MultitenantInstancer ¶
type MultitenantInstancer struct { DB DB Connecter platform.Connecter Logger log.Logger History history.DB MemcacheClient registry.MemcacheClient RegistryCacheExpiry time.Duration }
func (*MultitenantInstancer) Get ¶
func (m *MultitenantInstancer) Get(instanceID flux.InstanceID) (*Instance, error)
type NamedConfig ¶
type NamedConfig struct { ID flux.InstanceID Config Config }
type ServiceConfig ¶
func (ServiceConfig) Policy ¶
func (c ServiceConfig) Policy() flux.Policy
type StandaloneInstancer ¶
type StandaloneInstancer struct { Instance flux.InstanceID Connecter platform.Connecter Registry registry.Registry Config Configurer GitRepo git.Repo EventReader history.EventReader EventWriter history.EventWriter BaseLogger log.Logger }
StandaloneInstancer is the instancer for standalone mode
func (StandaloneInstancer) Get ¶
func (s StandaloneInstancer) Get(inst flux.InstanceID) (*Instance, error)