ihttp

package
v1.202405300917.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownAppPartition = errors.New("unknown app partition")
View Source
var ErrUnknownApplication = errors.New("unknown application")
View Source
var ErrUnknownDynamicSubresource = errors.New("unknown dynamic subresource")
View Source
var ErrUnknownDynamicSubresourceAlias = errors.New("unknown dynamic subresource alias")

Functions

This section is empty.

Types

type AcmeDomains

type AcmeDomains []string

type Alias

type Alias struct {
	Domain string
	Path   string
}

type CLIParams

type CLIParams struct {
	Port        int
	AcmeDomains AcmeDomains
}

type IHTTPProcessor

type IHTTPProcessor interface {
	iservices.IService
	ListeningPort() int
	AddReverseProxyRoute(srcRegExp, dstRegExp string)
	SetReverseProxyRouteDefault(srcRegExp, dstRegExp string)
	AddAcmeDomain(domain string)
	/*
		Static Content

		url structure:
		<cluster-domain>/static/<AppQName.owner>/<AppQName.name>/<StaticFolderQName.pkg>/<StaticFolderQName.entity>/<content-path>

		example:
		<cluster-domain>/static/sys/monitor/site/hello/index.html

		- nil fs means that Static Content should be removed
		- Same resource can be deployed multiple times
	*/
	DeployStaticContent(path string, fs fs.FS)

	// ErrUnknownApplication
	DeployAppPartition(app istructs.AppQName, partNo istructs.PartitionID, appPartitionRequestHandler ibus.RequestHandler) (err error)

	// ErrUnknownApplication
	//--	UndeployAllAppPartitions(app istructs.AppQName)
	DeployApp(app istructs.AppQName, numPartitions uint, numAppWS uint) (err error)
	UndeployAppPartition(app istructs.AppQName, partNo istructs.PartitionID) (err error)
	UndeployApp(app istructs.AppQName) (err error)
}

Proposed factory signature

type IRouterStorage

type IRouterStorage istorage.IAppStorage

func NewIRouterStorage

func NewIRouterStorage(appStorageProvider istorage.IAppStorageProvider) (IRouterStorage, error)

type ISender

type ISender interface {
	// err.Error() must have QName format:
	//   var ErrTimeoutExpired = errors.New("ibus.ErrTimeoutExpired")
	// NullHandler can be used as a reader
	Send(ctx context.Context, request interface{}, sectionsHandler SectionsHandlerType) (response interface{}, status Status, err error)
}

type SectionsHandlerType

type SectionsHandlerType func(section interface{})

type Status

type Status struct {
	// Ref. https://go.dev/src/net/http/status.go
	// StatusBadRequest(400) if server got the request but could not process it
	// StatusGatewayTimeout(504) if timeout expired
	HTTPStatus   int
	ErrorMessage string
	ErrorData    string
}

Jump to

Keyboard shortcuts

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