gcs

package
v0.0.0-...-18c2e1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const Scheme = "gcs"

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, bucket, pathPrefix string, maxConcurrentReads, maxConcurrentWrites, ttlInDays int, hedgeTimeout time.Duration) (cache.Cache, error)

Types

type GCSCache

type GCSCache struct {
	// contains filtered or unexported fields
}

func (*GCSCache) Contains

func (g *GCSCache) Contains(ctx context.Context, kind cache.EntryKind, hash string) (bool, int64, error)

Before being downloaded, each object's existence is checked from the ActionResult object. Take that opportunity to touch the object and thus update its CustomTime attribute to time.Now. This will allow for the object lifecycle management system to kick in and garbage collect old objects.

func (*GCSCache) Get

func (g *GCSCache) Get(ctx context.Context, kind cache.EntryKind, hash string, offset, length int64) (io.ReadCloser, int64, error)

func (*GCSCache) Put

func (g *GCSCache) Put(ctx context.Context, kind cache.EntryKind, hash string, size, offset int64) (io.WriteCloser, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL