app

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package app is the public entry point for embedding artel as a library.

internal/app cannot be imported outside this module (Go's internal-package rule), so an external repo that wants to build artel from source without forking it depends on github.com/ruf-dev/artel and imports this package instead:

import "github.com/ruf-dev/artel/pkg/app"

func main() {
	a, err := app.New()
	if err != nil {
		log.Fatal().Err(err).Msg("Failed to create application")
	}

	err = a.Start()
	if err != nil {
		log.Fatal().Err(err).Msg("Failed to start application")
	}
}

The resulting binary still needs the config/ directory (or -config) next to it at runtime, same as cmd/service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App = internalapp.App

App is artel's application instance: config, data sources, network listeners, and wired services/transports. It is an alias for internal/app.App, so its exported fields and methods (Start, ...) are usable from outside this module without importing internal/app directly.

func New

func New() (App, error)

New builds an App: loads config, opens data sources and network listeners, and wires all services/transports. Call Start on the result to run it.

Jump to

Keyboard shortcuts

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