strongoapp

package module
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvironmentNames = map[Environment]string{
	EnvUnknown:    "unknown",
	EnvProduction: "production",
	EnvStaging:    "staging",
	EnvDevTest:    "dev",
	EnvLocal:      "local",
}

EnvironmentNames is mapping of environment codes to environment names

Functions

func AddHTTPHandler

func AddHTTPHandler(pattern string, handler func(http.ResponseWriter, *http.Request))

AddHTTPHandler adds http handler with / suffix TODO: mark as deprecated?

Types

type AppContext

type AppContext interface {
}

AppContext is app context for an app Deprecated: use AppUserSettings instead

type AppUserSettings added in v0.3.1

type AppUserSettings interface {

	// AppUserCollectionName returns name of a collection for app user records
	AppUserCollectionName() string // TODO: Add a link to example of usage

	// NewAppUserData TODO: Needs documentation on intended use and examples of usage
	NewAppUserData() appuser.BaseUserData // TODO: Consider returning dalgo record
}

AppUserSettings is app user record setup for an app

type DefaultHttpAppHost added in v0.2.0

type DefaultHttpAppHost struct {
}

func (DefaultHttpAppHost) GetEnvironment added in v0.2.0

func (d DefaultHttpAppHost) GetEnvironment(c context.Context, r *http.Request) Environment

func (DefaultHttpAppHost) HandleWithContext added in v0.2.0

func (d DefaultHttpAppHost) HandleWithContext(handler HttpHandlerWithContext) func(w http.ResponseWriter, r *http.Request)

type Environment

type Environment int8

Environment defines environment

const (
	// EnvUnknown is unknown environment
	EnvUnknown Environment = iota
	// EnvProduction is production environment
	EnvProduction
	// EnvStaging is staging environment
	EnvStaging
	// EnvDevTest is developers test environment
	EnvDevTest
	// EnvLocal is developer's local environment
	EnvLocal
)

type ExecutionContext

type ExecutionContext interface {
	Context() context.Context
}

ExecutionContext is execution context for UI app Contains translator and context.Context

func NewExecutionContext

func NewExecutionContext(c context.Context) ExecutionContext

NewExecutionContext creates new execution context

type HttpAppHost added in v0.1.0

type HttpAppHost interface {
	GetEnvironment(c context.Context, r *http.Request) Environment
	HandleWithContext(handler HttpHandlerWithContext) func(w http.ResponseWriter, r *http.Request)
}

type HttpHandlerWithContext added in v0.1.0

type HttpHandlerWithContext func(c context.Context, w http.ResponseWriter, r *http.Request) // TODO: Should be somewhere else?

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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