gcs

package
Version: v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package gcs provides cache service by google cloud storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdmissionController added in v0.0.4

type AdmissionController interface {
	AdmitPut(context.Context, *pb.PutReq) error
}

AdmissionController checks incoming request.

type Cache

type Cache struct {
	pb.UnimplementedCacheServiceServer

	AdmissionController AdmissionController
	// contains filtered or unexported fields
}

Cache represents key-value cache using google cloud storage.

func New

func New(bkt *storage.BucketHandle) *Cache

New creates new cache.

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, in *pb.GetReq) (*pb.GetResp, error)

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, in *pb.PutReq) (*pb.PutResp, error)

func (*Cache) Stats

func (c *Cache) Stats() Stats

type Stats

type Stats struct {
	Hits int64
	Gets int64
}

Stats represents stats of gcs.Cache. TODO: use opencensus stats, view.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL