runtime

package
v0.0.10-dev Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonOptionArgs = "nonOptionArgs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	Run(args ...string) error
	Exit()
}

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 ArgumentsPropertySource

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

func NewPropertySource

func NewPropertySource(args *Arguments) *ArgumentsPropertySource

func (*ArgumentsPropertySource) ContainsProperty

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

func (*ArgumentsPropertySource) Name

func (s *ArgumentsPropertySource) Name() string

func (*ArgumentsPropertySource) NonOptionArgs

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

func (*ArgumentsPropertySource) OptionValues

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

func (*ArgumentsPropertySource) Property

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

func (*ArgumentsPropertySource) PropertyNames

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

func (*ArgumentsPropertySource) PropertyOrDefault

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

func (*ArgumentsPropertySource) Source

func (s *ArgumentsPropertySource) Source() any

type Context

type Context interface {
	context.Context

	event.Publisher
	event.ListenerRegistry

	Environment() env.Environment
	Container() container.Container
	Close()
}

type ContextClosedEvent

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

func ContextClosed

func ContextClosed(ctx Context) ContextClosedEvent

func (ContextClosedEvent) Context

func (e ContextClosedEvent) Context() Context

func (ContextClosedEvent) EventSource

func (e ContextClosedEvent) EventSource() any

func (ContextClosedEvent) Time

func (e ContextClosedEvent) Time() time.Time

type ContextCustomizer

type ContextCustomizer interface {
	CustomizeContext(ctx Context) error
}

type ContextLoadedEvent

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

func ContextLoaded

func ContextLoaded(app Application, args *Arguments, ctx Context) ContextLoadedEvent

func (ContextLoadedEvent) Application

func (e ContextLoadedEvent) Application() Application

func (ContextLoadedEvent) Args

func (e ContextLoadedEvent) Args() *Arguments

func (ContextLoadedEvent) Context

func (e ContextLoadedEvent) Context() Context

func (ContextLoadedEvent) EventSource

func (e ContextLoadedEvent) EventSource() any

func (ContextLoadedEvent) Time

func (e ContextLoadedEvent) Time() time.Time

type ContextPreparedEvent

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

func NewContextPreparedEvent

func NewContextPreparedEvent(app Application, args *Arguments, ctx Context) ContextPreparedEvent

func (ContextPreparedEvent) Application

func (e ContextPreparedEvent) Application() Application

func (ContextPreparedEvent) Args

func (e ContextPreparedEvent) Args() *Arguments

func (ContextPreparedEvent) Context

func (e ContextPreparedEvent) Context() Context

func (ContextPreparedEvent) EventSource

func (e ContextPreparedEvent) EventSource() any

func (ContextPreparedEvent) Time

func (e ContextPreparedEvent) Time() time.Time

type ContextStartedEvent

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

func ContextStarted

func ContextStarted(app Application, args *Arguments, ctx Context) ContextStartedEvent

func (ContextStartedEvent) Application

func (e ContextStartedEvent) Application() Application

func (ContextStartedEvent) Args

func (e ContextStartedEvent) Args() *Arguments

func (ContextStartedEvent) Context

func (e ContextStartedEvent) Context() Context

func (ContextStartedEvent) EventSource

func (e ContextStartedEvent) EventSource() any

func (ContextStartedEvent) Time

func (e ContextStartedEvent) Time() time.Time

type EnvironmentPreparedEvent

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

func EnvironmentPrepared

func EnvironmentPrepared(app Application, args *Arguments, ctx Context, environment env.Environment) EnvironmentPreparedEvent

func (EnvironmentPreparedEvent) Application

func (e EnvironmentPreparedEvent) Application() Application

func (EnvironmentPreparedEvent) Args

func (EnvironmentPreparedEvent) Context

func (e EnvironmentPreparedEvent) Context() Context

func (EnvironmentPreparedEvent) Environment

func (e EnvironmentPreparedEvent) Environment() env.Environment

func (EnvironmentPreparedEvent) EventSource

func (e EnvironmentPreparedEvent) EventSource() any

func (EnvironmentPreparedEvent) Time

type FailedEvent

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

func Failed

func Failed(app Application, args *Arguments, ctx Context, err error) FailedEvent

func (FailedEvent) Application

func (e FailedEvent) Application() Application

func (FailedEvent) Args

func (e FailedEvent) Args() *Arguments

func (FailedEvent) Context

func (e FailedEvent) Context() Context

func (FailedEvent) Err

func (e FailedEvent) Err() error

func (FailedEvent) EventSource

func (e FailedEvent) EventSource() any

func (FailedEvent) Time

func (e FailedEvent) Time() time.Time

type Lifecycle

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

type LifecycleProperties

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

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

type ReadyEvent

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

func Ready

func Ready(app Application, args *Arguments, ctx Context, timeTaken time.Duration) ReadyEvent

func (ReadyEvent) Application

func (e ReadyEvent) Application() Application

func (ReadyEvent) Args

func (e ReadyEvent) Args() *Arguments

func (ReadyEvent) Context

func (e ReadyEvent) Context() Context

func (ReadyEvent) EventSource

func (e ReadyEvent) EventSource() any

func (ReadyEvent) Time

func (e ReadyEvent) Time() time.Time

func (ReadyEvent) TimeTaken

func (e ReadyEvent) TimeTaken() time.Duration

type StartedEvent

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

func Started

func Started(app Application, args *Arguments, ctx Context, timeTaken time.Duration) StartedEvent

func (StartedEvent) Application

func (e StartedEvent) Application() Application

func (StartedEvent) Args

func (e StartedEvent) Args() *Arguments

func (StartedEvent) Context

func (e StartedEvent) Context() Context

func (StartedEvent) EventSource

func (e StartedEvent) EventSource() any

func (StartedEvent) Time

func (e StartedEvent) Time() time.Time

func (StartedEvent) TimeTaken

func (e StartedEvent) TimeTaken() time.Duration

type StartingEvent

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

func Starting

func Starting(app Application, args *Arguments, ctx Context) StartingEvent

func (StartingEvent) Application

func (e StartingEvent) Application() Application

func (StartingEvent) Args

func (e StartingEvent) Args() *Arguments

func (StartingEvent) Context

func (e StartingEvent) Context() Context

func (StartingEvent) EventSource

func (e StartingEvent) EventSource() any

func (StartingEvent) Time

func (e StartingEvent) Time() time.Time

type StartupListener

type StartupListener interface {
	OnStarting(ctx Context)
	OnEnvironmentPrepared(ctx Context, environment env.Environment)
	OnContextPrepared(ctx Context)
	OnContextLoaded(ctx Context)
	OnContextStarted(ctx Context)
	OnStarted(ctx Context, timeTaken time.Duration)
	OnReady(ctx Context, timeTaken time.Duration)
	OnFailed(ctx Context, err error)
}

type StartupListeners

type StartupListeners []StartupListener

func (StartupListeners) ContextLoaded

func (l StartupListeners) ContextLoaded(ctx Context)

func (StartupListeners) ContextPrepared

func (l StartupListeners) ContextPrepared(ctx Context)

func (StartupListeners) ContextStarted

func (l StartupListeners) ContextStarted(ctx Context)

func (StartupListeners) EnvironmentPrepared

func (l StartupListeners) EnvironmentPrepared(ctx Context, environment env.Environment)

func (StartupListeners) Failed

func (l StartupListeners) Failed(ctx Context, err error)

func (StartupListeners) Ready

func (l StartupListeners) Ready(ctx Context, timeTaken time.Duration)

func (StartupListeners) Started

func (l StartupListeners) Started(ctx Context, timeTaken time.Duration)

func (StartupListeners) Starting

func (l StartupListeners) Starting(ctx Context)

Directories

Path Synopsis
env

Jump to

Keyboard shortcuts

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