Documentation
¶
Overview ¶
Copyright 2020 Fugue, 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 ¶
- Constants
- func HashCommand(cmd *project.Command) (string, error)
- func HashFile(filePath string) (string, error)
- func HashString(s string) (string, error)
- func MapKeys(m map[string]string) (result []string)
- func NewMiddleware(s store.Store, user, mode string) project.RunnerBuilder
- type Cache
- type Entry
- type Error
- type Key
Constants ¶
const ( // ReadWrite is the default cache mode ReadWrite = "read-write" // WriteOnly mode is used to write to the cache but not read from it WriteOnly = "write-only" // Disabled mode bypasses all cache interactions Disabled = "disabled" )
const CacheMiss = Error("Item not found in cache")
CacheMiss indicates the cache did not contain a match
Variables ¶
This section is empty.
Functions ¶
func HashCommand ¶ added in v0.2.0
HashCommand returns a SHA1 hash of the command configuration
func HashString ¶
HashString returns the SHA1 hash of a string
func NewMiddleware ¶
func NewMiddleware(s store.Store, user, mode string) project.RunnerBuilder
NewMiddleware returns caching middleware
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache used to determine rule keys
func (*Cache) Key ¶
Key returns a struct of information that uniquely identifies the Rule's inputs and configuration. This used to store Rule outputs in the cache.
type Key ¶
type Key struct {
Project string `json:"project"`
Component string `json:"component"`
Rule string `json:"rule"`
Image string `json:"image"`
OutputCount int `json:"output_count"`
Inputs []*Entry `json:"inputs"`
Deps []*Entry `json:"deps"`
Env []*Entry `json:"env"`
Toolchain []*Entry `json:"toolchain"`
Version string `json:"version"`
Commands []string `json:"commands"`
Native bool `json:"native,omitempty"`
// contains filtered or unexported fields
}
Key contains information used to build a key