platform

package module
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 4 Imported by: 0

README

spa

Cloud Platform abstractions and other shared code to build cloud-native services.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpContext

func NewHttpContext(req *http.Request) context.Context

func ReportError

func ReportError(e error)

Types

type ErrorReportingProvider

type ErrorReportingProvider interface {
	ReportError(error)
}

type HttpRequestContextProvider

type HttpRequestContextProvider interface {
	NewHttpContext(*http.Request) context.Context
}

type InstanceProviderFunc

type InstanceProviderFunc func(string) interface{}

type LoggingProvider

type LoggingProvider interface {
	Log(string, ...interface{})
}

func Logger

func Logger(logID string) LoggingProvider

type Platform

type Platform struct {
	// contains filtered or unexported fields
}

func InitPlatform

func InitPlatform(ctx context.Context, opts ...PlatformOpts) (*Platform, error)

func RegisterPlatform

func RegisterPlatform(p *Platform) *Platform

type PlatformOpts

type PlatformOpts struct {
	ID   string
	Type ProviderType
	Impl InstanceProviderFunc
}

type ProviderType

type ProviderType int
const (
	ProviderTypeLogger ProviderType = iota
	ProviderTypeErrorReporter
	ProviderTypeHttpContext
)

func (ProviderType) String

func (l ProviderType) String() string

Returns the name of a provider type

Directories

Path Synopsis
pkg
env
id
provider

Jump to

Keyboard shortcuts

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