application

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 4 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 {
	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

func WithInstanceID(id string) Option

WithInstanceID sets the instance ID of the application.

func WithName

func WithName(name string) Option

WithName sets the name of the application.

func WithVersion

func WithVersion(v version.Version) Option

WithVersion sets the version of the application.

Jump to

Keyboard shortcuts

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