Back to

Package gcs

Latest Go to latest

The latest major version is .

Published: Jul 31, 2020 | License: BSD-3-Clause | Module:


Package gcs provides cache service by google cloud storage.


type AdmissionController

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

AdmissionController checks incoming request.

type Cache

type Cache struct {
	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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier