hosting

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAppConfig

func GetAppConfig() *config.AppConfig

Gets strongly typed the App configuration

func GetAzureCredential

func GetAzureCredential() azcore.TokenCredential

func GetAzureCredentialFunc

func GetAzureCredentialFunc() func() azcore.TokenCredential

Types

type App

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

func GetApp

func GetApp() *App

Gets the App instance running

func (*App) GetConfig

func (app *App) GetConfig() *config.AppConfig

GetConfig gets the app configuration

func (*App) GetHealthCheckResults

func (app *App) GetHealthCheckResults() []diagnostics.HealthCheckResult

whether the app is ready

func (*App) IsReady

func (app *App) IsReady() bool

whether the app is ready

func (*App) Name

func (app *App) Name() string

func (*App) Start

func (app *App) Start(options *AppStartOptions) error

Start starts the server port: the port to listen on configure: (optional) a function to configure the echo server

type AppBuilder

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

func NewAppBuilder

func NewAppBuilder(name string) *AppBuilder

func (*AppBuilder) AddConfig

func (b *AppBuilder) AddConfig(config *config.AppConfig) *AppBuilder

func (*AppBuilder) AddReadinessCheck

func (b *AppBuilder) AddReadinessCheck(check diagnostics.HealthCheck) *AppBuilder

adds readiness checks to the app instance when it starts. The order that the checks are added will be the order in which they are executed.

func (*AppBuilder) AddRoutes

func (b *AppBuilder) AddRoutes(configure ConfigureRoutesFunc) *AppBuilder

func (*AppBuilder) AddService

func (b *AppBuilder) AddService(service BackgroundService) *AppBuilder

func (*AppBuilder) AddTask

func (b *AppBuilder) AddTask(task tasks.Task) *AppBuilder

func (*AppBuilder) Build

func (b *AppBuilder) Build(configure ConfigureEchoFunc) *App

type AppStartOptions

type AppStartOptions struct {
	Port               *int
	ConfigureWebServer ConfigureEchoFunc
	WebServer          bool
}

type BackgroundService

type BackgroundService interface {
	Start()
	Stop()
	GetName() string
}

service that can be run in the background, started and stopped

type ConfigureAppConfigFunc

type ConfigureAppConfigFunc func(config any)

type ConfigureEchoFunc

type ConfigureEchoFunc func(e *echo.Echo)

type ConfigureRoutesFunc

type ConfigureRoutesFunc func(options *RouteOptions)

type Route

type Route struct {
	Name        string
	Method      string
	Path        string
	HandlerFunc echo.HandlerFunc
}

A route definition we can use to wire up all routes

type RouteOptions

type RouteOptions struct {
	AppConfig any
	Routes    *Routes
}

type Routes

type Routes []Route

type SecurityContext

type SecurityContext struct {
}

func (*SecurityContext) GetAzureCredential

func (c *SecurityContext) GetAzureCredential() azcore.TokenCredential

Jump to

Keyboard shortcuts

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