app

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonOptionArgs = "nonOptionArgs"
)
View Source
const Version = "v0.0.1-dev"

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	Context() Context
	Run(args ...string)
}

func New

func New() Application

type Arguments

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

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 (*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

	ApplicationName() string
	DisplayName() string
	StartupTime() time.Time
	Environment() env.Environment
	Container() container.Container
	Start() error
}

type ContextCustomizer

type ContextCustomizer interface {
	CustomizeContext(ctx Context) error
}

type ContextLoadedEvent

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

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 (*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 (*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 DefaultLifecycleProcessor

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

func NewDefaultLifecycleProcessor

func NewDefaultLifecycleProcessor() *DefaultLifecycleProcessor

func (*DefaultLifecycleProcessor) IsRunning

func (p *DefaultLifecycleProcessor) IsRunning() bool

func (*DefaultLifecycleProcessor) Start

func (p *DefaultLifecycleProcessor) Start() error

func (*DefaultLifecycleProcessor) Stop

func (p *DefaultLifecycleProcessor) Stop() error

type EnvironmentPreparedEvent

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

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 (*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() error
	Stop(ctx context.Context) error
	IsRunning() bool
}

type LifecycleProcessor

type LifecycleProcessor interface {
	Start() error
	Stop() 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 (*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 (*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 (*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 SystemEnvironmentPropertySource

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

func (*SystemEnvironmentPropertySource) ContainsProperty

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

func (*SystemEnvironmentPropertySource) Name

func (*SystemEnvironmentPropertySource) Property

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

func (*SystemEnvironmentPropertySource) PropertyNames

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

func (*SystemEnvironmentPropertySource) PropertyOrDefault

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

func (*SystemEnvironmentPropertySource) Source

Directories

Path Synopsis
env

Jump to

Keyboard shortcuts

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