pluginsrv

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsTLS

func IsTLS(w http.ResponseWriter, r *http.Request) bool

func IsTLSMiddleware added in v0.0.21

func IsTLSMiddleware(next http.Handler) http.Handler

IsTLSMiddleware is a middleware that checks if the request is TLS. This is a convenience wrapper around IsTLS.

func Serve

func Serve[H repository.Handler](ln net.Listener, service Service[H]) (errFn error)

Types

type Config

type Config struct {
	Router *chi.Mux
	Gossip gossip.Config
	Info   *pluginv1.Info
}

type Service

type Service[H repository.Handler] interface {
	// Start starts the service's HTTP server.
	Start(http.RoundTripper, *mtls.CAPEM, *gossip.BeskarMeta) error

	// Context returns the service's context.
	Context() context.Context

	// Config returns the service's configuration.
	Config() Config

	// RepositoryManager returns the service's repository manager.
	// For plugin's without a repository manager, this method should return nil.
	RepositoryManager() *repository.Manager[H]
}

Jump to

Keyboard shortcuts

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