platform

package module
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 4 Imported by: 0

README

fupas/platform

This library is a lightweight golang runtime abstaction to build cloud-native services independent from the infrastructure the service is deployed on.

The interfaces are inspired by the Google AppEngine and Google Cloud Platform APIs and first platform provider targets GCP only. Deployment in containers independent from a particular Cloud Provider will be next (TBD!).

In addition to provide basic service abstractions (e.g. logging) fupas/platform also implements "higher-functions" e.g. opinionated service authentication and authorization or a simple key/value store.

Packages

Packages Description
platform not sure ...
observer Provides observability, i.e. logging and error reporting abstractions
analytics Reporting of 'events' e.g. page visits or e-commerce transactions
services (deprecated) will be remove or replaced, don't bother

Dependencies

While fupas/platform SHOULD have as less dependencies to other libraries as possible, it does not re-invent the wheel. It uses, or "borrows" code from the following modules/repos/projects:

Dependency Repo
labstack/echo https://github.com/labstack/echo
dapr/dapr https://github.com/dapr/dapr
dapr/components-contrib https://github.com/dapr/components-contrib

References

A list of useful posts, resources and references:

Documentation

Index

Constants

View Source
const (
	DatastoreProvider     = "DATASTORE"
	StorageProvider       = "STORAGE"
	ErroReportingProvider = "ERROR"
	LoggingProvider       = "LOGGING"
	MetricsProvider       = "METRICS"
)

Variables

This section is empty.

Functions

func ReportError

func ReportError(err error)

Types

type Client

type Client struct {
	// Datastore
	// Storage
	// ErrorReporting provider
	ErrorReportingImpl errorreporting.ErrorReportingFunc
}

func NewClient

func NewClient(ctx context.Context, with ...ProviderImplementation) (*Client, error)

NewClient initializes a new platform client and initializes it with the given provider implemenations

func NewDefaultClient

func NewDefaultClient(ctx context.Context, with ...ProviderImplementation) (*Client, error)

NewDefaultClient initializes a new platform client and initializes it with default providers

func RegisterGlobally

func RegisterGlobally(cl *Client) *Client

RegisterGlobally replaces the current global platform client with a new one

type ProviderImplementation

type ProviderImplementation interface {
	ProviderType() string
	Implementation(context.Context) interface{}
}

Directories

Path Synopsis
examples
pkg
provider

Jump to

Keyboard shortcuts

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