File: cache.go

package info (click to toggle)
golang-github-aws-smithy-go 1.19.0-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 2,680 kB
  • sloc: java: 15,917; xml: 166; sh: 131; makefile: 66
file content (19 lines) | stat: -rw-r--r-- 741 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Package cache defines the interface for a key-based data store.
//
// This package is designated as private and is intended for use only by the
// smithy client runtime. The exported API therein is not considered stable and
// is subject to breaking changes without notice.
package cache

// Cache defines the interface for an opaquely-typed, key-based data store.
//
// The thread-safety of this interface is undefined and is dictated by
// implementations.
type Cache interface {
	// Retrieve the value associated with the given key. The returned boolean
	// indicates whether the cache held a value for the given key.
	Get(k interface{}) (interface{}, bool)

	// Store a value under the given key.
	Put(k interface{}, v interface{})
}