service

package
v0.0.0-...-90229f9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Defer

func Defer(ctx context.Context)

Defer contains all calls to be executed as a defer in main

func Init

func Init(key string, spec Spec) (ctx context.Context)

Init a service This contains our common boilerplate code required for every service inside the events project

Types

type BaseSpec

type BaseSpec struct {
	Debug       bool   `default:"false" help:"set debug mode (default: false)"`
	SentryDSN   string `help:"sentry dsn key"`
	IsProd      bool   `` /* 142-byte string literal not displayed */
	Local       bool   `envconfig:"local" default:"false" help:"setting local to true, enables human readable logging"`
	MetricsPort int    `envconfig:"metricsPort" default:"8080" help:"the metric server port (default: 8080)"`
}

BaseSpec stores all common service variables

func (BaseSpec) Base

func (b BaseSpec) Base() BaseSpec

Base returns itself

type GoogleImpersonationSpec

type GoogleImpersonationSpec struct {
	User           string `envconfig:"google_user" required:"true" help:"impersonation user for the google api"`
	ServiceAccount string `envconfig:"google_application_credentials" required:"true" help:"path to google service account file"`
}

GoogleImpersonationSpec stores a ServiceAccount and a User field for Google Auth with impersonation

type GoogleSpec

type GoogleSpec struct {
	User           string `envconfig:"google_user" required:"false" help:"impersonation user for the google api"`
	ServiceAccount string `envconfig:"google_application_credentials" required:"true" help:"path to google service account file"`
}

GoogleSpec stores a ServiceAccount and an optional User field for Google Auth

type Spec

type Spec interface {
	Base() BaseSpec
}

Spec is defining the common interface for service specification

Jump to

Keyboard shortcuts

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