caching

package
v0.0.0-...-9994f1b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package caching provides interfaces for managing DataStore entities that correspond to the caching service

Index

Constants

View Source
const CachingServiceKind string = "CachingService"

CachingServiceKind is the datastore entity kind for chrome platforms.

Variables

This section is empty.

Functions

func BatchUpdateCachingServices

func BatchUpdateCachingServices(ctx context.Context, cachingServices []*ufspb.CachingService) ([]*ufspb.CachingService, error)

BatchUpdateCachingServices updates CachingServices in datastore.

This is a non-atomic operation and doesn't check if the object already exists before update. Must be used within a transaction where objects are checked before update. Will lead to partial updates if not used in a transaction.

func CreateCachingService

func CreateCachingService(ctx context.Context, cs *ufspb.CachingService) (*ufspb.CachingService, error)

CreateCachingService creates a new CachingService in datastore.

func DeleteCachingService

func DeleteCachingService(ctx context.Context, name string) error

DeleteCachingService deletes the CachingService in datastore.

func GetCachingService

func GetCachingService(ctx context.Context, name string) (*ufspb.CachingService, error)

GetCachingService returns CachingService for the given name from datastore.

func GetCachingServiceIndexedFieldName

func GetCachingServiceIndexedFieldName(input string) (string, error)

GetCachingServiceIndexedFieldName returns the index name.

func ListAllCachingServices

func ListAllCachingServices(ctx context.Context, keysOnly bool) (res []*ufspb.CachingService, err error)

ListAllCachingServices returns all caching services in datastore.

func ListCachingServices

func ListCachingServices(ctx context.Context, pageSize int32, pageToken string, filterMap map[string][]interface{}, keysOnly bool) (res []*ufspb.CachingService, nextPageToken string, err error)

ListCachingServices lists the CachingServices.

Does a query over CachingService entities. Returns up to pageSize entities, plus non-nil cursor (if there are more results). pageSize must be positive.

Types

type CSEntity

type CSEntity struct {
	Extra datastore.PropertyMap `gae:",extra"`
	ID    string                `gae:"$id"`
	State string                `gae:"state"`
	// b/188491698: The field of Subnet has been deprecated. Use 'Subnets'
	// instead.
	Subnet  string   `gae:"subnet"`
	Subnets []string `gae:"subnets"`
	Zones   []string `gae:"zones"`
	// ufspb.CachingService cannot be directly used as it contains pointer.
	CachingService []byte `gae:",noindex"`
	// contains filtered or unexported fields
}

CSEntity is a datastore entity that tracks a platform.

func (*CSEntity) GetProto

func (e *CSEntity) GetProto() (proto.Message, error)

GetProto returns the unmarshaled CachingService.

func (*CSEntity) Validate

func (e *CSEntity) Validate() error

Validate returns whether a CSEntity is valid.

Jump to

Keyboard shortcuts

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