runtime

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

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

Application выполняет роль Оркестратора для списка серверов.

func NewApplication

func NewApplication(opts Options, servers ...Server) *Application

func (*Application) Run

func (a *Application) Run(ctx context.Context) error

Run starts the application and waits for it to finish.

type CloserServer

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

CloserServer — "виртуальный" Server для освобождения ресурсов на shutdown.

func NewCloserServer

func NewCloserServer(name string, closeFn func(context.Context) error) *CloserServer

func (*CloserServer) Name

func (s *CloserServer) Name() string

func (*CloserServer) Start

func (s *CloserServer) Start(ctx context.Context) error

func (*CloserServer) Stop

func (s *CloserServer) Stop(ctx context.Context) error

type Options

type Options struct {
	ShutdownTimeout time.Duration
}

type Server

type Server interface {
	Name() string
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Server описывает интерфейс server. Конфигурация внедряется через конструктор конкретного сервера.

Jump to

Keyboard shortcuts

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