Documentation ¶
Index ¶
- Variables
- func Close()
- func DeleteKeysWithSize(size int64) error
- func GenerateCacheFileName() string
- func GenerateKey(bucketName string, blobName string) string
- func GetCacheFileNames(size int64) (set.Set, error)
- func GetKeys(size int64) (set.Set, error)
- func RunGC() error
- func SetRecord(key string, record *Record) error
- type Record
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRecordNotFound キーをもとにストアを探したがレコードがなかった ErrRecordNotFound = errors.New("record not found") )
Functions ¶
func DeleteKeysWithSize ¶
DeleteKeysWithSize size分だけキーを適当に消す
func GenerateKey ¶
GenerateKey bucketNameとblobNameからKVSで使うkeyを作る
func GetCacheFileNames ¶
GetCacheFileNames 指定サイズ分のcache file nameを返す size 0なら全て
Types ¶
type Record ¶
type Record struct { BlobName string `json:"blob_name"` // GCSのbucket内での名前 CacheFileName string `json:"cache_file_name"` // キャッシュのファイル名 UUID Size int64 `json:"size"` // ファイルサイズ ContentType string `json:"content_type"` // ContentType LastRequestedAt time.Time `json:"last_requested_at"` CreatedAt time.Time `json:"created_at"` }
Record storeに保存するデータ
func (*Record) MarshalBinary ¶
MarshalBinary Record -> json
func (*Record) UnmarshalBinary ¶
UnmarshalBinary json -> Record
Click to show internal directories.
Click to hide internal directories.