runtime

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Index

Constants

View Source
const (
	NonOptionArgs = "nonOptionArgs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

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

func ParseArguments

func ParseArguments(args []string) (*Arguments, error)

func (*Arguments) ContainsOption

func (a *Arguments) ContainsOption(name string) bool

func (*Arguments) NonOptionArgs

func (a *Arguments) NonOptionArgs() []string

func (*Arguments) OptionNames

func (a *Arguments) OptionNames() []string

func (*Arguments) OptionValues

func (a *Arguments) OptionValues(name string) []string

type ArgumentsSource

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

func NewArgumentsSource

func NewArgumentsSource(args *Arguments) *ArgumentsSource

func (*ArgumentsSource) ContainsProperty

func (s *ArgumentsSource) ContainsProperty(name string) bool

func (*ArgumentsSource) Name

func (s *ArgumentsSource) Name() string

func (*ArgumentsSource) NonOptionArgs

func (s *ArgumentsSource) NonOptionArgs() []string

func (*ArgumentsSource) OptionValues

func (s *ArgumentsSource) OptionValues(name string) []string

func (*ArgumentsSource) Property

func (s *ArgumentsSource) Property(name string) (any, bool)

func (*ArgumentsSource) PropertyNames

func (s *ArgumentsSource) PropertyNames() []string

func (*ArgumentsSource) PropertyOrDefault

func (s *ArgumentsSource) PropertyOrDefault(name string, defaultValue any) any

func (*ArgumentsSource) Source

func (s *ArgumentsSource) Source() any
type Banner interface {
	PrintBanner(writer io.Writer) error
}

type CommandLineRunner added in v0.0.14

type CommandLineRunner interface {
	Run(ctx context.Context, args *Arguments) error
}

type Context

type Context interface {
	context.Context
	event.Publisher

	Start() error
	Stop() error
	IsRunning() bool
	AddEventListeners(listeners ...event.Listener) error

	Environment() Environment
	Container() component.Container
}

type ContextConfigurer

type ContextConfigurer interface {
	ConfigureContext(ctx Context) error
}

type DefaultEnvironment

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

func NewDefaultEnvironment

func NewDefaultEnvironment() *DefaultEnvironment

func (*DefaultEnvironment) ActiveProfiles

func (e *DefaultEnvironment) ActiveProfiles() []string

func (*DefaultEnvironment) AddActiveProfile

func (e *DefaultEnvironment) AddActiveProfile(profiles ...string) error

func (*DefaultEnvironment) DefaultProfiles

func (e *DefaultEnvironment) DefaultProfiles() []string

func (*DefaultEnvironment) IsProfileActive

func (e *DefaultEnvironment) IsProfileActive(profile string) bool

func (*DefaultEnvironment) Merge

func (e *DefaultEnvironment) Merge(parent Environment)

func (*DefaultEnvironment) PropertyResolver

func (e *DefaultEnvironment) PropertyResolver() property.Resolver

func (*DefaultEnvironment) PropertySources

func (e *DefaultEnvironment) PropertySources() *property.Sources

func (*DefaultEnvironment) SetActiveProfiles

func (e *DefaultEnvironment) SetActiveProfiles(profiles ...string) error

func (*DefaultEnvironment) SetDefaultProfiles

func (e *DefaultEnvironment) SetDefaultProfiles(profiles ...string) error

type Environment

type Environment interface {
	ActiveProfiles() []string
	DefaultProfiles() []string
	IsProfileActive(profile string) bool

	SetActiveProfiles(profiles ...string) error
	AddActiveProfile(profile ...string) error
	SetDefaultProfiles(profiles ...string) error
	Merge(parent Environment)

	PropertySources() *property.Sources
	PropertyResolver() property.Resolver
}

type EnvironmentSource

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

func NewEnvironmentSource

func NewEnvironmentSource() *EnvironmentSource

func (*EnvironmentSource) ContainsProperty

func (s *EnvironmentSource) ContainsProperty(name string) bool

func (*EnvironmentSource) Name

func (s *EnvironmentSource) Name() string

func (*EnvironmentSource) Property

func (s *EnvironmentSource) Property(name string) (any, bool)

func (*EnvironmentSource) PropertyNames

func (s *EnvironmentSource) PropertyNames() []string

func (*EnvironmentSource) PropertyOrDefault

func (s *EnvironmentSource) PropertyOrDefault(name string, defaultValue any) any

func (*EnvironmentSource) Source

func (s *EnvironmentSource) Source() any

type Lifecycle added in v0.0.15

type Lifecycle interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	IsRunning() bool
}

type LifecycleProperties added in v0.0.17

type LifecycleProperties struct {
	property.Properties `prefix:"procyon.lifecycle"`

	ShutdownTimeout time.Duration `prop:"shutdown-timeout" default:"30000"`
}

func NewLifecycleProperties added in v0.0.17

func NewLifecycleProperties() *LifecycleProperties

type Server added in v0.0.14

type Server interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Port() int
}

type ServerProperties added in v0.0.17

type ServerProperties struct {
	property.Properties `prefix:"procyon.server"`

	Port int `prop:"port"`
}

func NewServerProperties added in v0.0.17

func NewServerProperties() *ServerProperties

type ShutdownEvent added in v0.0.17

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

func NewShutdownEvent added in v0.0.17

func NewShutdownEvent(ctx Context) ShutdownEvent

func (ShutdownEvent) Context added in v0.0.17

func (s ShutdownEvent) Context() Context

func (ShutdownEvent) EventSource added in v0.0.17

func (s ShutdownEvent) EventSource() any

func (ShutdownEvent) EventTime added in v0.0.17

func (s ShutdownEvent) EventTime() time.Time

type StartupEvent added in v0.0.17

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

func NewStartupEvent added in v0.0.17

func NewStartupEvent(ctx Context) StartupEvent

func (StartupEvent) Context added in v0.0.17

func (s StartupEvent) Context() Context

func (StartupEvent) EventSource added in v0.0.17

func (s StartupEvent) EventSource() any

func (StartupEvent) EventTime added in v0.0.17

func (s StartupEvent) EventTime() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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