rserverless

package
v3.15.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Services = map[string]NewService{}

Services is a map of service name and its new function.

Functions

func Register

func Register(name string, newFunc NewService)

Register registers a new serverless service with name and new function.

Types

type NewService

type NewService func(context.Context, map[string]any) (Service, error)

NewService is the function that serverless services need to register at init time.

type Option

type Option func(*Serverless)

func WithLogger

func WithLogger(log *zerolog.Logger) Option

func WithServices

func WithServices(svc map[string]Service) Option

type Serverless

type Serverless struct {
	Services map[string]Service
	// contains filtered or unexported fields
}

Serverless contains the serveless collection of services.

func New

func New(opt ...Option) (*Serverless, error)

New returns a new serverless collection of services.

func (*Serverless) GracefulStop

func (s *Serverless) GracefulStop() error

GracefulStop gracefully stops the serverless services.

func (*Serverless) Start

func (s *Serverless) Start() error

Start starts the serverless service collection.

func (*Serverless) Stop

func (s *Serverless) Stop() error

Stop stops the serverless services with a one second deadline.

type Service

type Service interface {
	Start()
	Close(ctx context.Context) error
}

Service represents a serverless service.

Jump to

Keyboard shortcuts

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