gcs

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: BSD-3-Clause Imports: 13 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 Cache

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

Jump to

Keyboard shortcuts

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