cloud

package
v0.0.0-...-8ff35f7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 3

Documentation

Overview

Package cloud provides an implementation of services based on regular Cloud APIs and works from anywhere (not necessarily from AppEngine).

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is an error that can be returned to indicate that the requested functionality is not implemented.

Functions

This section is empty.

Types

type ConfigLite

type ConfigLite struct {
	// IsDev is true if this is a development execution.
	IsDev bool

	// ProjectID, if not empty, is the project ID returned by the "info" service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	ProjectID string

	// ServiceName, if not empty, is the service (module) name returned by the
	// "info" service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	ServiceName string

	// VersionName, if not empty, is the version name returned by the "info"
	// service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	VersionName string

	// InstanceID, if not empty, is the instance ID returned by the "info"
	// service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	InstanceID string

	// RequestID, if not empty, is the request ID returned by the "info"
	// service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	RequestID string

	// ServiceAccountName, if not empty, is the service account name returned by
	// the "info" service.
	//
	// If empty, the service will treat requests for this field as not
	// implemented.
	ServiceAccountName string

	// DS is the Cloud Datastore client.
	//
	// If populated, the datastore service will be installed.
	DS *datastore.Client
}

ConfigLite can be used to configure a context to have supported Cloud Services clients and ONLY them.

Currently supports only datastore and its required dependencies.

Unlike Config, it doesn't try to setup logging, intercept HTTP requests, provide auth, etc.

func (*ConfigLite) Use

Use configures the context with implementation of Cloud Services.

Any services that are missing will have "impl/dummy" stubs installed. These stubs will panic if called.

Jump to

Keyboard shortcuts

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