rapi

package
v0.0.0-...-6be47e1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CredentialsAPIRouter

func CredentialsAPIRouter(credentialsService core.CredentialsService) http.Handler

func ExtensionsRouter

func ExtensionsRouter(appCtx appctx.ApplicationContext, registrationService core.RegistrationService, renderingService *rendering.EventRenderingService) http.Handler

ExtensionsRouter returns a new instance of chi router implementing Extensions Runtime API specification.

func LogsAPIRouter

func LogsAPIRouter(registrationService core.RegistrationService, logsSubscriptionAPI telemetry.SubscriptionAPI) http.Handler

LogsAPIRouter returns a new instance of chi router implementing Logs API specification.

func LogsAPIStubRouter

func LogsAPIStubRouter() http.Handler

LogsAPIStubRouter returns a new instance of chi router implementing a stub of Logs API that always returns a non-committal response to prevent customer code from crashing when Logs API is disabled locally

func NewRouter

func NewRouter(appCtx appctx.ApplicationContext, registrationService core.RegistrationService, renderingService *rendering.EventRenderingService) http.Handler

NewRouter returns a new instance of chi router implementing Runtime API specification.

func SaveConnInContext

func SaveConnInContext(ctx context.Context, c net.Conn) context.Context

func TelemetryAPIRouter

func TelemetryAPIRouter(registrationService core.RegistrationService, telemetrySubscriptionAPI telemetry.SubscriptionAPI) http.Handler

TelemetryRouter returns a new instance of chi router implementing Telemetry API specification.

func TelemetryAPIStubRouter

func TelemetryAPIStubRouter() http.Handler

TelemetryStubRouter returns a new instance of chi router implementing a stub of Telemetry API that always returns a non-committal response to prevent customer code from crashing when Telemetry API is disabled locally

Types

type Server

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

Server is a Runtime API server

func NewServer

func NewServer(
	host string,
	port int,
	appCtx appctx.ApplicationContext,
	registrationService core.RegistrationService,
	renderingService *rendering.EventRenderingService,
	telemetryAPIEnabled bool,
	logsSubscriptionAPI telemetry.SubscriptionAPI,
	telemetrySubscriptionAPI telemetry.SubscriptionAPI,
	credentialsService core.CredentialsService,
) *Server

NewServer creates a new Runtime API Server

Unlike net/http server's ListenAndServe, we separate Listen() and Serve(), this is done to guarantee order: call to Listen() should happen before provided runtime is started.

When port is 0, OS will dynamically allocate the listening port.

func (*Server) Close

func (s *Server) Close() error

Close forcefully closes listeners & connections

func (*Server) Host

func (s *Server) Host() string

Host is server's host

func (*Server) Listen

func (s *Server) Listen() error

Listen on port

func (*Server) Port

func (s *Server) Port() int

Port is server's port

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve requests and close on cancelation signals

func (*Server) Shutdown

func (s *Server) Shutdown() error

Shutdown gracefully shuts down server

func (*Server) URL

func (s *Server) URL(endpoint string) string

URL is full server url for specified endpoint

Directories

Path Synopsis
Package rendering provides stateful event rendering service.
Package rendering provides stateful event rendering service.

Jump to

Keyboard shortcuts

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