Documentation
¶
Index ¶
- type App
- func (a *App) FindDirectories(pattern string) ([]string, error)
- func (a *App) FindFiles(pattern string) ([]string, error)
- func (a *App) FindFilesWithContent(pattern string, regex *regexp.Regexp) []string
- func (a *App) HasFile(path string) bool
- func (a *App) HasMatch(pattern string) bool
- func (a *App) IsFileExecutable(name string) bool
- func (a *App) ReadFile(name string) (string, error)
- func (a *App) ReadJSON(name string, v interface{}) error
- func (a *App) ReadTOML(name string, v interface{}) error
- func (a *App) ReadYAML(name string, v interface{}) error
- type Environment
- func (e *Environment) ConfigVariable(name string) string
- func (e *Environment) GetConfigVariable(name string) (string, string)
- func (e *Environment) GetSecretsWithPrefix(prefix string) []string
- func (e *Environment) GetVariable(name string) string
- func (e *Environment) IsConfigVariableTruthy(name string) bool
- func (e *Environment) SetVariable(name, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Source string
// contains filtered or unexported fields
}
func (*App) FindDirectories ¶
FindDirectories returns a list of directory paths matching a glob pattern
func (*App) FindFilesWithContent ¶ added in v0.0.35
func (*App) IsFileExecutable ¶
IsFileExecutable checks if a path is an executable file
func (*App) ReadFile ¶
ReadFile reads the contents of a file within the application source directory
type Environment ¶
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