strongoapp

package module
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LocalHostEnv = "local"
View Source
var UnknownEnv = "unknown"

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

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

type DefaultHttpAppHost struct {
}

func (DefaultHttpAppHost) GetEnvironment

func (d DefaultHttpAppHost) GetEnvironment(_ context.Context, r *http.Request) string

func (DefaultHttpAppHost) HandleWithContext

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

HandleWithContext calls handler with a context.Background()

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

type HttpAppHost interface {

	// GetEnvironment determines environment based on request
	GetEnvironment(c context.Context, r *http.Request) string

	// HandleWithContext - calls handler with a context.Context specific to app/host/request
	HandleWithContext(handler HttpHandlerWithContext) func(w http.ResponseWriter, r *http.Request)
}

HttpAppHost - TODO: document purpose

type HttpHandlerWithContext

type HttpHandlerWithContext func(c context.Context, w http.ResponseWriter, r *http.Request)

HttpHandlerWithContext - TODO: document purpose

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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