Documentation ¶
Overview ¶
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2016-2019 Uber Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Executor
- type Remote
- type RemoteValidator
- type Remotes
- type RemotesConfig
- type Store
- func (s *Store) AddFailed(r persistedretry.Task) error
- func (s *Store) AddPending(r persistedretry.Task) error
- func (s *Store) Find(query interface{}) ([]persistedretry.Task, error)
- func (s *Store) GetFailed() ([]persistedretry.Task, error)
- func (s *Store) GetPending() ([]persistedretry.Task, error)
- func (s *Store) MarkFailed(r persistedretry.Task) error
- func (s *Store) MarkPending(r persistedretry.Task) error
- func (s *Store) Remove(r persistedretry.Task) error
- type Task
- type TaskMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor executes tag replication tasks.
func NewExecutor ¶
func NewExecutor( stats tally.Scope, originCluster blobclient.ClusterClient, tagClientProvider tagclient.Provider) *Executor
NewExecutor creates a new Executor.
type Remote ¶
type Remote struct {
// contains filtered or unexported fields
}
Remote represents a remote build-index.
type RemoteValidator ¶
RemoteValidator validates remotes.
type Remotes ¶
type Remotes []*Remote
Remotes represents all namespaces and their configured remote build-indexes.
type RemotesConfig ¶
RemotesConfig defines remote replication configuration which specifies which namespaces should be replicated to certain build-indexes.
For example, given the configuration:
build-index-zone1: - namespace_foo/.* build-index-zone2: - namespace_foo/.*
Any builds matching the namespace_foo/.* namespace should be replicated to zone1 and zone2 build-indexes.
func (RemotesConfig) Build ¶
func (c RemotesConfig) Build() (Remotes, error)
Build builds configuration into Remotes.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores tags to be replicated asynchronously.
func NewStore ¶
func NewStore(db *sqlx.DB, rv RemoteValidator) (*Store, error)
NewStore creates a new Store.
func (*Store) AddFailed ¶
func (s *Store) AddFailed(r persistedretry.Task) error
AddFailed adds r as failed.
func (*Store) AddPending ¶
func (s *Store) AddPending(r persistedretry.Task) error
AddPending adds r as pending.
func (*Store) Find ¶
func (s *Store) Find(query interface{}) ([]persistedretry.Task, error)
Find is not supported.
func (*Store) GetFailed ¶
func (s *Store) GetFailed() ([]persistedretry.Task, error)
GetFailed returns all failed tasks.
func (*Store) GetPending ¶
func (s *Store) GetPending() ([]persistedretry.Task, error)
GetPending returns all pending tasks.
func (*Store) MarkFailed ¶
func (s *Store) MarkFailed(r persistedretry.Task) error
MarkFailed marks r as failed.
func (*Store) MarkPending ¶
func (s *Store) MarkPending(r persistedretry.Task) error
MarkPending marks r as pending.
type Task ¶
type Task struct { Tag string `db:"tag"` Digest core.Digest `db:"digest"` Dependencies core.DigestList `db:"dependencies"` Destination string `db:"destination"` CreatedAt time.Time `db:"created_at"` LastAttempt time.Time `db:"last_attempt"` Failures int `db:"failures"` Delay time.Duration `db:"delay"` }
Task contains information to replicate a tag and its dependencies to a remote destination.
func NewTask ¶
func NewTask( tag string, d core.Digest, dependencies core.DigestList, destination string, delay time.Duration) *Task
NewTask creates a new Task.
func (*Task) GetFailures ¶
GetFailures returns the number of times t has failed.
func (*Task) GetLastAttempt ¶
GetLastAttempt returns when t was last attempted.
type TaskMatcher ¶
type TaskMatcher struct {
// contains filtered or unexported fields
}
TaskMatcher is a gomock Matcher which matches two tasks.
func (*TaskMatcher) Matches ¶
func (m *TaskMatcher) Matches(x interface{}) bool
Matches compares two tasks. It ignores checking for time.
func (*TaskMatcher) String ¶
func (m *TaskMatcher) String() string
String returns the name of the matcher.