Documentation ¶
Index ¶
- Constants
- Variables
- type Environment
- func (e *Environment) FormatTime(timestamp *time.Time) (formatted string)
- func (e *Environment) FormatTimeStamp(timestamp int64) string
- func (e *Environment) GetBookmarkFileName(name string) string
- func (e *Environment) GetBookmarksFileInfos() ([]os.FileInfo, error)
- func (e *Environment) GetHistFileName() (fileName string, err error)
- func (e *Environment) GetTraceFileName(hash string) string
- func (e *Environment) GetTracesFileInfos() ([]os.FileInfo, error)
- func (e *Environment) ReadFromConfig() (configEnv *Environment, err error)
- func (e *Environment) String() string
Constants ¶
const ( // ShellBash defines code name of the Bash shell ShellBash = "bash" // ShellZsh defines code name of the Z Shell ShellZsh = "zsh" )
Variables ¶
var ( // CreatedAt defines the timestamp when the launched CreatedAt = time.Now().Unix() )
Functions ¶
This section is empty.
Types ¶
type Environment ¶
type Environment struct { Shell string `yaml:"shell"` HistFile string `yaml:"histfile"` HistTimeFormat string `yaml:"histtimeformat"` HomeDir string `yaml:"homedir"` AppDir string `yaml:"appdir"` TmpDir string `yaml:"tmpdir"` TracesDir string `yaml:"tracesdir"` BookmarksDir string `yaml:"bookmarksdir"` AutoCommandsFileName string `yaml:"autocommands"` ConfigFileName string `yaml:"config"` }
Environment defines common structure which carries all information about environment where ah is executed.
func MakeDefaultEnvironment ¶
func MakeDefaultEnvironment() (env *Environment)
MakeDefaultEnvironment creates environment with default settings.
func MergeEnvironments ¶
func MergeEnvironments(envs ...*Environment) (result *Environment)
MergeEnvironments combines several environments into one.
func (*Environment) FormatTime ¶
func (e *Environment) FormatTime(timestamp *time.Time) (formatted string)
FormatTime formats a given time structure accroding to the settings.
func (*Environment) FormatTimeStamp ¶
func (e *Environment) FormatTimeStamp(timestamp int64) string
FormatTimeStamp is just a small wrapper around FormatTime method.
func (*Environment) GetBookmarkFileName ¶
func (e *Environment) GetBookmarkFileName(name string) string
GetBookmarkFileName returns filename of the bookmark based on the given name.
func (*Environment) GetBookmarksFileInfos ¶
func (e *Environment) GetBookmarksFileInfos() ([]os.FileInfo, error)
GetBookmarksFileInfos returns file metadata structures on all bookmarks.
func (*Environment) GetHistFileName ¶
func (e *Environment) GetHistFileName() (fileName string, err error)
GetHistFileName returns filename of the history file or error if something goes wrong (e.g unsupported shell).
func (*Environment) GetTraceFileName ¶
func (e *Environment) GetTraceFileName(hash string) string
GetTraceFileName returns filename of the trace based on the given hash.
func (*Environment) GetTracesFileInfos ¶
func (e *Environment) GetTracesFileInfos() ([]os.FileInfo, error)
GetTracesFileInfos returns file metadata structures on all traces.
func (*Environment) ReadFromConfig ¶
func (e *Environment) ReadFromConfig() (configEnv *Environment, err error)
ReadFromConfig reads environment from config file.
func (*Environment) String ¶
func (e *Environment) String() string