app

package
v0.0.68 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Source string
}

func NewApp

func NewApp(path string) (*App, error)

func (*App) FindDirectories

func (a *App) FindDirectories(pattern string) ([]string, error)

FindDirectories returns a list of directory paths matching a glob pattern

func (*App) FindFiles

func (a *App) FindFiles(pattern string) ([]string, error)

FindFiles returns a list of file paths matching a glob pattern

func (*App) FindFilesWithContent added in v0.0.35

func (a *App) FindFilesWithContent(pattern string, regex *regexp.Regexp) []string

func (*App) HasMatch

func (a *App) HasMatch(pattern string) bool

HasMatch checks if a path matching a glob exists (files or directories)

func (*App) IsFileExecutable

func (a *App) IsFileExecutable(name string) bool

IsFileExecutable checks if a path is an executable file

func (*App) ReadFile

func (a *App) ReadFile(name string) (string, error)

ReadFile reads the contents of a file

func (*App) ReadJSON

func (a *App) ReadJSON(name string, v interface{}) error

ReadJSON reads and parses a JSON file

func (*App) ReadTOML

func (a *App) ReadTOML(name string, v interface{}) error

ReadTOML reads and parses a TOML file

func (*App) ReadYAML

func (a *App) ReadYAML(name string, v interface{}) error

ReadYAML reads and parses a YAML file

type Environment

type Environment struct {
	Variables map[string]string
}

func FromEnvs

func FromEnvs(envs []string) (*Environment, error)

FromEnvs collects variables from the given environment variable names

func NewEnvironment

func NewEnvironment(variables *map[string]string) *Environment

func (*Environment) ConfigVariable

func (e *Environment) ConfigVariable(name string) string

ConfigVariable returns the RAILPACK_ prefixed version of a variable name

func (*Environment) GetConfigVariable

func (e *Environment) GetConfigVariable(name string) (string, string)

GetConfigVariable returns the value of a RAILPACK_ prefixed variable with newlines removed Returns both the value and the name of the config variable

func (*Environment) GetSecretsWithPrefix added in v0.0.11

func (e *Environment) GetSecretsWithPrefix(prefix string) []string

GetSecretsWithPrefix returns all secrets that have the given prefix

func (*Environment) GetVariable

func (e *Environment) GetVariable(name string) string

GetVariable returns the value of the given variable name

func (*Environment) IsConfigVariableTruthy

func (e *Environment) IsConfigVariableTruthy(name string) bool

IsConfigVariableTruthy checks if a RAILPACK_ prefixed variable is set to "1" or "true"

func (*Environment) SetVariable

func (e *Environment) SetVariable(name, value string)

SetVariable stores a variable in the Environment

Jump to

Keyboard shortcuts

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