Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
ManifestCache
// contains filtered or unexported fields
}
Cache contains cached values for a path
func (*Cache) GetManifestHash ¶
GetManifestHash loads the saved manifest hash from cache
func (*Cache) NewManifestHash ¶
NewManifestHash creates a hash unique to the manifest
The source of the manifest provided should be noted since values from hooks might not be the same as the API response.
type CacheMock ¶
type CacheMock struct {
mock.Mock
ManifestCache
}
func NewCacheMock ¶
func NewCacheMock() *CacheMock
NewCacheMock creates a temporary cache for testing
This mock should overwrite existing caches after setups are performed:
cc := cache.NewCacheMock()
cc.On("GetManifestHash", mock.Anything, mock.Anything).
Return("placeholder", nil)
proj := config.NewProjectConfigMock()
proj.On("Cache").Return(cc)
clientsMock.Config.ProjectConfig = proj
Mocked arguments can be more specific to mimic unique cache response.
func (*CacheMock) GetManifestHash ¶
func (*CacheMock) NewManifestHash ¶
type Hash ¶
type Hash string
Hash is a mapped value for a specific input
type ManifestCache ¶
type ManifestCache struct {
Apps map[string]ManifestCacheApp
}
ManifestCache stores values of an app manifest
type ManifestCacheApp ¶
type ManifestCacheApp struct {
Hash Hash `json:"hash"` // Hash is a computed value unique to a manifest
}
ManifestCacheApp contains cache details for a specific app manifest
type ManifestCacher ¶
type ManifestCacher interface {
GetManifestHash(ctx context.Context, appID string) (Hash, error)
NewManifestHash(ctx context.Context, manifest types.AppManifest) (Hash, error)
SetManifestHash(ctx context.Context, appID string, hash Hash) error
}
ManifestCacher saves and retrieves specific manifest values