{"modulePath":"github.1git.de/openshift/origin","version":"v4.1.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controller\n\n## Variables\n\n```go\nvar ErrNotImportable = errors.New(\"requested image cannot be imported\")\n```\n\n## Types\n\n```go\ntype ImageStreamController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewImageStreamController(client imagev1client.Interface, informer imagev1informer.ImageStreamInformer) *ImageStreamController\n```\nNewImageStreamController returns a new image stream import controller.\n\n```go\nfunc (c *ImageStreamController) Run(workers int, stopCh \u003c-chan struct{})\n```\nRun begins watching and syncing.\n\n```go\nfunc (c *ImageStreamController) SetNotifier(n Notifier)\n```\n\n```go\ntype ImportMetricCounter struct {\n\t// contains filtered or unexported fields\n}\n```\nImportMetricCounter counts numbers of successful and failed imports for the purpose of metrics collection.\n\n```go\nfunc NewImportMetricCounter() *ImportMetricCounter\n```\nNewImportMetricCounter returns a new ImportMetricCounter\n\n```go\nfunc (c *ImportMetricCounter) Collect() (metrics.ImportSuccessCounts, metrics.ImportErrorCounts, error)\n```\nCollect is supposed to be called by the metrics collector. It returns the actual state of counters.\n\n```go\nfunc (c *ImportMetricCounter) Increment(isi *imagev1.ImageStreamImport, err error)\n```\nIncrement processes the given image stream import object as a result of successful or failed import and increments the counters. The given error will be used to construct reason of the error\\_count metric unless any reason is found in the image stream import object. It's safe to call this method with any of the parameters nil.\n\n```go\ntype Notifier interface {\n\t// Importing is invoked when the controller is going to import an image stream\n\tImporting(stream *imagev1.ImageStream)\n}\n```\nNotifier provides information about when the controller makes a decision\n\n```go\ntype ScheduledImageStreamController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewScheduledImageStreamController(client imagev1client.Interface, informer imagev1informer.ImageStreamInformer, opts ScheduledImageStreamControllerOptions) *ScheduledImageStreamController\n```\nNewScheduledImageStreamController returns a new scheduled image stream import controller.\n\n```go\nfunc (s *ScheduledImageStreamController) Importing(stream *imagev1.ImageStream)\n```\nImporting is invoked when the controller decides to import a stream in order to push back the next schedule time.\n\n```go\nfunc (s *ScheduledImageStreamController) Run(stopCh \u003c-chan struct{})\n```\nRun begins watching and syncing.\n\n```go\ntype ScheduledImageStreamControllerOptions struct {\n\tResync time.Duration\n\n\t// Enabled indicates that the scheduled imports for images are allowed.\n\tEnabled bool\n\n\t// DefaultBucketSize is the default bucket size used by QPS.\n\tDefaultBucketSize int\n\n\t// MaxImageImportsPerMinute sets the maximum number of simultaneous image imports per\n\t// minute.\n\tMaxImageImportsPerMinute int\n}\n```\nImageStreamControllerOptions represents a configuration for the scheduled image stream import controller.\n\n```go\nfunc (opts ScheduledImageStreamControllerOptions) Buckets() int\n```\nBuckets returns the bucket size calculated based on the resync interval of the scheduled image import controller. For resync interval bigger than our the bucket size is doubled, for resync lower then 10 minutes bucket size is set to a half of the default size.\n\n```go\nfunc (opts ScheduledImageStreamControllerOptions) BucketsToQPS() float32\n```\nBucketsToQPS converts the bucket size to QPS\n\n```go\nfunc (opts ScheduledImageStreamControllerOptions) GetRateLimiter() flowcontrol.RateLimiter\n```\nGetRateLimiter returns a flowcontrol rate limiter based on the maximum number of imports (MaxImageImportsPerMinute) setting.\n\n","path":"github.1git.de/openshift/origin/pkg/image/controller","name":"controller","synopsis":"","isRedistributable":true}
