Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
Name string
Version version.Version
Environment environment.Environment
InstanceID string
}
Application is a configuration structure for applications, containing basic metadata for an application.
func New ¶
func New(opts ...Option) (Application, error)
New allocates an Application.
If [Application.InstanceID] is not set, it generates a new UUID v7 instance ID.
func (Application) FullInstanceName ¶
func (c Application) FullInstanceName() string
FullInstanceName returns the full instance name of the application, including the environment.
func (Application) InstanceName ¶
func (c Application) InstanceName() string
InstanceName returns the instance name of the application.
func (Application) String ¶
func (c Application) String() string
String returns a string representation of the application configuration.
type Option ¶
type Option func(*Application)
func WithEnvironment ¶
func WithEnvironment(env environment.Environment) Option
WithEnvironment sets the environment of the application.
func WithInstanceID ¶
WithInstanceID sets the instance ID of the application.
func WithVersion ¶
WithVersion sets the version of the application.
Click to show internal directories.
Click to hide internal directories.