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/>.
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/>.
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/>.
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 AliveContext() (context.Context, context.CancelFunc)
- func Do(f func(context.Context) error)
- func InstanceID() string
- func InstanceName() string
- func NewServer(ctx context.Context, handler http.Handler, lg Logger) (*http.Server, error)
- func OnGCE() bool
- func WaitForCleanup(timeout time.Duration) error
- type LogClient
- type Logger
- func (l Logger) Alert(args ...interface{})
- func (l Logger) AlertErr(err error) error
- func (l Logger) Alertf(format string, args ...interface{}) string
- func (l Logger) Critical(args ...interface{})
- func (l Logger) CriticalErr(err error) error
- func (l Logger) Criticalf(format string, args ...interface{}) string
- func (l Logger) Debug(args ...interface{})
- func (l Logger) DebugErr(err error) error
- func (l Logger) Debugf(format string, args ...interface{}) string
- func (l Logger) Default(args ...interface{})
- func (l Logger) DefaultErr(err error) error
- func (l Logger) Defaultf(format string, args ...interface{}) string
- func (l Logger) Emergency(args ...interface{})
- func (l Logger) EmergencyErr(err error) error
- func (l Logger) Emergencyf(format string, args ...interface{}) string
- func (l Logger) Error(args ...interface{})
- func (l Logger) ErrorErr(err error) error
- func (l Logger) Errorf(format string, args ...interface{}) string
- func (l Logger) Info(args ...interface{})
- func (l Logger) InfoErr(err error) error
- func (l Logger) Infof(format string, args ...interface{}) string
- func (l Logger) Notice(args ...interface{})
- func (l Logger) NoticeErr(err error) error
- func (l Logger) Noticef(format string, args ...interface{}) string
- func (l Logger) StandardLogger(severity logging.Severity) *stdlog.Logger
- func (l Logger) Warning(args ...interface{})
- func (l Logger) WarningErr(err error) error
- func (l Logger) Warningf(format string, args ...interface{}) string
- type MetadataType
- type StorageClient
Constants ¶
const RequestContextKey = requestContextKey(`gkeRequestContextKey`)
Variables ¶
var ( LogGke bool LogStd bool )
Functions ¶
func AliveContext ¶ added in v0.0.24
func AliveContext() (context.Context, context.CancelFunc)
AliveContext returns a context that is used to communicate a shutdown to various parts of an application.
func InstanceID ¶ added in v0.0.24
func InstanceID() string
func InstanceName ¶ added in v0.0.16
func InstanceName() string
func WaitForCleanup ¶ added in v0.0.24
Types ¶
type Logger ¶ added in v0.0.3
func (Logger) CriticalErr ¶ added in v0.0.24
func (Logger) DefaultErr ¶ added in v0.0.24
func (Logger) EmergencyErr ¶ added in v0.0.24
func (Logger) Emergencyf ¶ added in v0.0.24
func (Logger) StandardLogger ¶ added in v0.0.12
func (Logger) WarningErr ¶ added in v0.0.24
type MetadataType ¶ added in v0.0.24
type MetadataType struct { OnGCE bool ProjectID string InstanceID string InstanceName string ExternalIP string InternalIP string Hostname string Zone string InstanceTags []string InstanceAttributes map[string]string ProjectAttributes map[string]string }
func Metadata ¶ added in v0.0.24
func Metadata() *MetadataType
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)