Documentation ¶
Index ¶
- Variables
- func AppendIfMissing(slice []string, i string) []string
- func InitialRunner(item *Items, client *http.Client, service RedirectRepository) error
- func MainRunner(ctx context.Context, item *Items, client *http.Client, ...)
- func StringNotInSlice(a string, list []string) bool
- type Children
- type Item
- type Items
- type RedirectRepository
- type RedirectService
- type Repos
- type Tags
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // NrTagsPromoted metrics NrTagsPromoted = promauto.NewCounter(prometheus.CounterOpts{ Name: "nr_tags_promoted_total", Help: "The total number of tags being promoted", }) // HistArtifactory metrics HistArtifactory = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "request_from_artifactory", Help: "Historgram get from artifactory", Buckets: []float64{0.1, 0.2, 0.5, 1, 2, 5}, }, []string{"repoImage"}) // HistWebhook metrics HistWebhook = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "request_to_webhook", Help: "Historgram post to webhook", Buckets: []float64{0.1, 0.2, 0.5, 1, 2, 5}, }, []string{"repoImage"}) )
Functions ¶
func AppendIfMissing ¶
AppendIfMissing takes a list and adds unique values to that list
func InitialRunner ¶ added in v0.4.0
func InitialRunner(item *Items, client *http.Client, service RedirectRepository) error
InitialRunner creates the initial data in the database, getting all the data that currently exist in your repo
func MainRunner ¶ added in v0.4.0
MainRunner the main for loop of promoterChecker
func StringNotInSlice ¶
StringInSlice checks if a string is in the existing list
Types ¶
type Items ¶ added in v0.4.0
type Items struct { Containers []Item `yaml:"containers"` ArtifactoryURL string `yaml:"artifactoryURL"` ArtifactoryAPIkey string `yaml:"artifactoryAPIkey"` ArtifactoryUSER string `yaml:"artifactoryUSER"` PollTime int `yaml:"pollTime"` HTTPtimeout int `yaml:"httpTimeout"` HTTPinsecure bool `yaml:"httpInsecure"` WebhookSecret string `yaml:"webhookSecret"` DBType string `yaml:"dbType"` EndpointPort int `yaml:"endpointPort"` }
Items config file struct
type RedirectRepository ¶
type RedirectService ¶
type RedirectService interface { Store(repoImage string, artrepo string, image string, tags []string) error Read(repoImage string) ([]string, error) UpdateTags(repoImage string, repo string, image string, newTags []string) error }
func NewRedirectService ¶
func NewRedirectService(redirectRepo RedirectRepository) RedirectService
Source Files ¶
Click to show internal directories.
Click to hide internal directories.