Help us shape the future of Go! Take the 2026 Go Developer Survey

procyon

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

README

procyon-logo

Procyon Framework

Procyon is an application framework for Go that helps you build modern, production-ready applications with minimal boilerplate.

Installation

To install Procyon, run the following command:

go get -u go.codnect.io/procyon/...

Overview

Building production-ready Go applications often requires combining multiple libraries and integrating them into a cohesive application.

As applications grow, managing infrastructure code and keeping these components working together can introduce unnecessary complexity and boilerplate.

Procyon simplifies application development by providing the essential capabilities needed to build modern Go applications, allowing you to focus on your business logic instead of infrastructure.

Quick Start

Create a new application:

package main

import (
    "os"
	
    "go.codnect.io/procyon"
)

func main() {
    if err := procyon.Run(); err != nil {
        os.Exit(1)
    }
}

Documentation

Read the full documentation at https://go.codnect.io/procyon.

License

Procyon Framework is released under version 2.0 of the Apache License.

Documentation

Index

Constants

View Source
const (
	// DefaultProfilesProp is the property key for specifying default profiles.
	DefaultProfilesProp = "procyon.profiles.default"
	// ActiveProfilesProp is the property key for specifying active profiles.
	ActiveProfilesProp = "procyon.profiles.active"

	// DefaultConfigLocation is the default location for configuration files.
	DefaultConfigLocation = "resources/"
)
View Source
const (
	Version = "v0.0.1-dev"
)

Variables

This section is empty.

Functions

func Run

func Run(args ...string) error

Run creates an application with the default configuration and starts it with the given command-line arguments.

Types

type Application

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

Application is the main entry point of the Procyon framework. It is responsible for initializing the application context, loading resources, and running the application.

func New

func New() *Application

New creates a new instance of the application with default banner printer and resource resolver.

func (*Application) ResourceResolver

func (a *Application) ResourceResolver() io.ResourceResolver

ResourceResolver returns the resource resolver used by the application to load resources.

func (*Application) Run

func (a *Application) Run(args ...string) (err error)

Run starts the application with the given command-line arguments. It initializes the environment, prepares the application context, and invokes any command-line runners defined in the application context.

func (*Application) SetBannerPrinter

func (a *Application) SetBannerPrinter(printer runtime.BannerPrinter)

SetBannerPrinter sets the banner printer to be used by the application to print the banner at startup.

type BannerPrinter

type BannerPrinter struct {
}

func NewBannerPrinter

func NewBannerPrinter() *BannerPrinter

func (*BannerPrinter) Print

type Context

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

Context struct represents the application context of Procyon.

func (*Context) Close

func (c *Context) Close(ctx context.Context) error

Close stops the application context, destroys all singleton components, releases resources, and marks the context as canceled.

func (*Context) Container

func (c *Context) Container() component.Container

Container returns the component container associated with this context. It panics if the context has not been refreshed yet.

func (*Context) Deadline

func (c *Context) Deadline() (deadline time.Time, ok bool)

Deadline method returns the time when work done on behalf of this context should be canceled.

func (*Context) Done

func (c *Context) Done() <-chan struct{}

Done method returns a channel that's closed when work done on behalf of this context should be canceled.

func (*Context) Environment

func (c *Context) Environment() runtime.Environment

Environment returns the runtime environment associated with this context.

func (*Context) Err

func (c *Context) Err() error

Err returns the error that caused the context to terminate. It returns nil if the context is still active.

func (*Context) IsRunning

func (c *Context) IsRunning() bool

IsRunning returns true if the application context is currently running, false otherwise.

func (*Context) Refresh

func (c *Context) Refresh(ctx context.Context) error

Refresh initializes the application context by preparing the container, loading component definitions, initializing singleton components, and starting lifecycle management.

func (*Context) ResourceResolver

func (c *Context) ResourceResolver() io.ResourceResolver

ResourceResolver returns the resource resolver used by the application to load resources.

func (*Context) Start

func (c *Context) Start(ctx context.Context) error

Start starts the application context. It loads component definitions, registers the context itself as a singleton, and initializes singleton components. After this method is called, the context is considered running.

func (*Context) Stop

func (c *Context) Stop(ctx context.Context) error

Stop stops the application context by shutting down lifecycle components. If the context is not running, it returns nil.

func (*Context) Value

func (c *Context) Value(key any) any

Value returns the value associated with the given key. Context values are currently not supported and this method always returns nil.

type Environment

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

Environment represents the default implementation of the Environment interface.

func NewEnvironment

func NewEnvironment() *Environment

NewEnvironment creates a new Environment.

func (*Environment) ActiveProfiles

func (e *Environment) ActiveProfiles() []string

ActiveProfiles returns the active profiles.

func (*Environment) AddActiveProfiles

func (e *Environment) AddActiveProfiles(profiles ...string) error

AddActiveProfiles adds active profiles.

func (*Environment) DefaultProfiles

func (e *Environment) DefaultProfiles() []string

DefaultProfiles returns the default profiles.

func (*Environment) IsProfileActive

func (e *Environment) IsProfileActive(profile string) bool

IsProfileActive checks if a profile is active.

func (*Environment) PropertyResolver

func (e *Environment) PropertyResolver() config.PropertyResolver

PropertyResolver returns the property resolver.

func (*Environment) PropertySources

func (e *Environment) PropertySources() *config.PropertySources

PropertySources returns the property sources.

func (*Environment) SetActiveProfiles

func (e *Environment) SetActiveProfiles(profiles ...string) error

SetActiveProfiles sets the active profiles.

func (*Environment) SetDefaultProfiles

func (e *Environment) SetDefaultProfiles(profiles ...string) error

SetDefaultProfiles sets the default profiles.

Directories

Path Synopsis
cmd
procyon command

Jump to

Keyboard shortcuts

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