github.com/hyperledger/aries-framework-go@v0.3.2/pkg/doc/verifiable/cache.go (about)

     1  // +build !js,!wasm
     2  
     3  /*
     4  Copyright SecureKey Technologies Inc. All Rights Reserved.
     5  
     6  SPDX-License-Identifier: Apache-2.0
     7  */
     8  
     9  package verifiable
    10  
    11  import (
    12  	"time"
    13  
    14  	"github.com/VictoriaMetrics/fastcache"
    15  )
    16  
    17  // NewExpirableSchemaCache creates new instance of ExpirableSchemaCache.
    18  func NewExpirableSchemaCache(size int, expiration time.Duration) *ExpirableSchemaCache {
    19  	return &ExpirableSchemaCache{
    20  		cache:      fastcache.New(size),
    21  		expiration: expiration,
    22  	}
    23  }