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 FileStore
- type NameQuery
- 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 write back tasks.
func NewExecutor ¶
NewExecutor creates a new Executor.
func (*Executor) Exec ¶
func (e *Executor) Exec(r persistedretry.Task) error
Exec uploads the cache file corresponding to r's digest to the remote backend that matches r's namespace.
type FileStore ¶
type FileStore interface { DeleteCacheFileMetadata(name string, md metadata.Metadata) error GetCacheFileReader(name string) (store.FileReader, error) }
FileStore defines store operations required for write-back.
type NameQuery ¶
type NameQuery struct {
// contains filtered or unexported fields
}
NameQuery queries writeback tasks which match a name.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store stores writeback tasks.
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 finds tasks matching query.
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 { Namespace string `db:"namespace"` Name string `db:"name"` CreatedAt time.Time `db:"created_at"` LastAttempt time.Time `db:"last_attempt"` Failures int `db:"failures"` Delay time.Duration `db:"delay"` // Deprecated. Use name instead. Digest core.Digest `db:"digest"` }
Task contains information to write back a blob to remote storage.
func NewTask ¶
NewTask creates a new Task.
func TaskFixture ¶
func TaskFixture() *Task
TaskFixture returns a randomly generated Task for testing purposes.
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.