github.com/confluentinc/confluent-kafka-go@v1.9.2/schemaregistry/cache/cache.go (about)

     1  /**
     2   * Copyright 2022 Confluent Inc.
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *
     8   * http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  package cache
    18  
    19  // Cache represents a key-value storage where to put cached data
    20  type Cache interface {
    21  	// Get returns the cache value associated with key
    22  	//
    23  	// Parameters:
    24  	//  * `key` - the key to retrieve
    25  	//
    26  	// Returns the value associated with key and a bool that is `false`
    27  	// if the key was not found
    28  	Get(key interface{}) (interface{}, bool)
    29  	// Put puts a value in cache associated with key
    30  	//
    31  	// Parameters:
    32  	//  * `key` - the key to put
    33  	//  * `value` - the value to put
    34  	Put(key interface{}, value interface{})
    35  	// Delete deletes the cache entry associated with key
    36  	//
    37  	// Parameters:
    38  	//  * `key` - the key to delete
    39  	Delete(key interface{})
    40  	// ToMap returns the current cache entries copied into a map
    41  	ToMap() map[interface{}]interface{}
    42  }