Documentation
¶
Index ¶
- func WithConfig(config *config.Config) func(*Core)
- func WithMsgChan(msgChan *chan common.Msg) func(*Core)
- type Command
- type Commands
- type Core
- func (c *Core) AddCommand(name string, command string) common.Msg
- func (c *Core) AddCommandToProject(projectName string, commandName string) common.Msg
- func (c *Core) AddDomainAlias(projectName string, domainAlias string) common.Msg
- func (c *Core) AddProject(name string, port int64, commandNames []string) common.Msg
- func (c *Core) AddVariable(projectName string, key string, value string) common.Msg
- func (c *Core) CommandExists(name string) (bool, Command)
- func (c *Core) FetchCommands() error
- func (c *Core) FetchProjects() error
- func (c *Core) GetCommandNames() []string
- func (c *Core) GetCommands() ([]Command, error)
- func (c *Core) GetConfig() *config.Config
- func (c *Core) GetProjectDir(projectName string) common.Msg
- func (c *Core) GetProjectNames() []string
- func (c *Core) GetProjects() (Projects, error)
- func (c *Core) GetSigChan() *chan os.Signal
- func (c *Core) Init() common.Msg
- func (c *Core) InitSqliteDB() error
- func (c *Core) ProjectExists(name string) (bool, Project)
- func (c *Core) RemoveCommand(name string) common.Msg
- func (c *Core) RemoveCommandFromProject(projectName string, commandName string) common.Msg
- func (c *Core) RemoveDomainAlias(projectName string, domainAlias string) common.Msg
- func (c *Core) RemoveProject(name string) common.Msg
- func (c *Core) RemoveVariable(projectName string, key string) common.Msg
- func (c *Core) RenameCommand(oldName string, newName string) common.Msg
- func (c *Core) RenameProject(oldName string, newName string) common.Msg
- func (c *Core) SetErr(err io.Writer)
- func (c *Core) SetOut(out io.Writer)
- func (c *Core) SetProjectDir(projectName string, dir *string) common.Msg
- func (c *Core) TryToRun(name string) common.Msg
- func (c *Core) UpdateCommand(name string, command string) common.Msg
- func (c *Core) UpdateProject(name string, port int64, commandNames []string) common.Msg
- type DomainAlias
- type Project
- type Projects
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithConfig ¶
Optional function to set the config of the Core when creating a new instance.
func WithMsgChan ¶
Optional function to set the message channel of the Core when creating a new instance.
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is the main struct for the core package.
It contains the config, message channel, commands and projects. The config is used to read and update the configuration. The message channel is used to send messages to the CLI or the app.
func (*Core) AddCommand ¶
Add a command with the given name and command string.
func (*Core) AddCommandToProject ¶
Add a command to the project with the given name.
func (*Core) AddDomainAlias ¶ added in v0.7.0
Add a domain alias to the given project.
func (*Core) AddProject ¶
Add a project with the given name, port and command names.
func (*Core) AddVariable ¶
Add a variable with the given key and value to the project with the given name.
func (*Core) CommandExists ¶ added in v0.6.0
Check if a command with the given name exists. Returns the command if it exists.
func (*Core) FetchCommands ¶ added in v0.9.0
func (*Core) FetchProjects ¶ added in v0.9.0
func (*Core) GetCommandNames ¶
Get all the names of the commands.
func (*Core) GetCommands ¶
Get the commands from the database.
func (*Core) GetProjectDir ¶
Get the directory for the project with the given name.
func (*Core) GetProjectNames ¶
Get all the names of the projects.
func (*Core) GetProjects ¶
Get the projects from the database.
func (*Core) GetSigChan ¶ added in v0.7.2
Get the signal channel of the Core instance.
func (*Core) InitSqliteDB ¶ added in v0.9.0
func (*Core) ProjectExists ¶
Check if a project with the given name exists. Returns the project if it exists.
func (*Core) RemoveCommand ¶
Remove the command with the given name.
func (*Core) RemoveCommandFromProject ¶
Remove the command with the given commandName from the project with the given projectName.
func (*Core) RemoveDomainAlias ¶ added in v0.7.0
Remove a domain alias from the given project.
func (*Core) RemoveProject ¶
Remove the project with the given name.
func (*Core) RemoveVariable ¶
Remove the variable with the given key from the project with the given name.
func (*Core) RenameCommand ¶ added in v0.6.0
Rename the command with the given old name to the given new name.
func (*Core) RenameProject ¶ added in v0.6.0
Rename the project with the given old name to the given new name.
func (*Core) SetProjectDir ¶
Set the directory for the project with the given name.
func (*Core) UpdateCommand ¶ added in v0.6.0
Update the command with the given name to the given command string.
type DomainAlias ¶ added in v0.9.0
type DomainAlias = sqlc.DomainAlias