cloudenv

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: MIT Imports: 5 Imported by: 0

README

Cloud Env Build Status

Google App Engine standard Go environment no longer has built-in APIs for accesing internal services and it creates a lot of pain when establishing various client connections (Datastore, Logging, Cloudtasks etc).

Cloudenv tackles this problem by writing all the boilerplate connection code for you.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddContextValues

func AddContextValues(ctx context.Context) context.Context

AddContextValues adds context values

func CloudTasks

func CloudTasks(ctx context.Context) *cloudtasks.Client

CloudTasks gets cloudtasks client from context

func ContextValues

func ContextValues() map[interface{}]interface{}

ContextValues context values

func Datastore

func Datastore(ctx context.Context) *datastore.Client

Datastore gets datastore client from context

func DefaultEmail

func DefaultEmail() string

DefaultEmail default service account email

func Dispose

func Dispose()

Dispose disposes resources

func Init

func Init(ctx context.Context, config Config) error

Init initializes cloud env

func IsDev

func IsDev() bool

IsDev is dev server

func IsDevContext

func IsDevContext(ctx context.Context) bool

IsDevContext is dev server

func Logging

func Logging(ctx context.Context) *logging.Client

Logging gets logging client from context

func ProjectID

func ProjectID() string

ProjectID project ID

func ZoneID

func ZoneID() string

ZoneID zone ID

Types

type Config

type Config struct {
	Datastore  bool
	CloudTasks bool
	Logging    bool
}

Config config

Jump to

Keyboard shortcuts

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