Documentation ¶
Overview ¶
Copyright © 2020 A. Jensen <jensen.aaro@gmail.com>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func Alive() (context.Context, context.CancelFunc)
- func InstanceName() string
- func NewServer(ctx context.Context, handler http.Handler, lg Logger) (*http.Server, error)
- func OnGCE() bool
- func ProjectID() string
- type LogClient
- type LogId
- type LogParentId
- type Logger
- type StorageClient
Constants ¶
const RequestContextKey = requestContextKey(`gkeRequestContextKey`)
Variables ¶
var ( LogGke bool = true LogStd bool = true )
Functions ¶
func Alive ¶
func Alive() (context.Context, context.CancelFunc)
Alive returns a context that is used to communicate a shutdown to various parts of an application.
func InstanceName ¶ added in v0.0.16
func InstanceName() string
Types ¶
type LogClient ¶
func NewLogClientWithOptions ¶ added in v0.0.12
func NewLogClientWithOptions(ctx context.Context, parent LogParentId, opts ...logging.LoggerOption) (LogClient, func(), error)
type LogParentId ¶ added in v0.0.12
type LogParentId string
func NewLogParentId ¶ added in v0.0.12
func NewLogParentId() LogParentId
type Logger ¶ added in v0.0.3
type Logger interface { StandardLogger(severity logging.Severity) *log.Logger Log(entry logging.Entry) Logf(severity logging.Severity, format string, args ...interface{}) string Infof(format string, args ...interface{}) string Noticef(format string, args ...interface{}) string Warnf(format string, args ...interface{}) string Errorf(format string, args ...interface{}) string InfoErr(err error) error NoticeErr(err error) error WarnErr(err error) error ErrorErr(err error) error Flush() error }
func NewLoggerWithOptions ¶ added in v0.0.12
type StorageClient ¶ added in v0.0.12
type StorageClient interface { HMACKeyHandle(projectID, accessID string) *storage.HMACKeyHandle CreateHMACKey(ctx context.Context, projectID, serviceAccountEmail string, opts ...storage.HMACKeyOption) (*storage.HMACKey, error) ListHMACKeys(ctx context.Context, projectID string, opts ...storage.HMACKeyOption) *storage.HMACKeysIterator ServiceAccount(ctx context.Context, projectID string) (string, error) Bucket(name string) *storage.BucketHandle Buckets(ctx context.Context, projectID string) *storage.BucketIterator }
func NewStorageClient ¶ added in v0.0.12
func NewStorageClient(ctx context.Context) (StorageClient, func(), error)