core

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithConfig

func WithConfig(config *config.Config) func(*Core)

func WithMsgChan

func WithMsgChan(msgChan *chan common.Msg) func(*Core)

Types

type Commands

type Commands map[string]string

type Core

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

func New

func New(options ...func(*Core)) *Core

func (*Core) AddCommand

func (c *Core) AddCommand(name string, command string) common.Msg

func (*Core) AddCommandToProject

func (c *Core) AddCommandToProject(projectName string, commandName string) common.Msg

func (*Core) AddProject

func (c *Core) AddProject(name string, domain string, port int, commandNames []string) common.Msg

func (*Core) AddVariable

func (c *Core) AddVariable(name string, key string, value string) common.Msg

func (*Core) GetCommandNames

func (c *Core) GetCommandNames() []string

func (*Core) GetCommands

func (c *Core) GetCommands() (Commands, error)

func (*Core) GetCommandsConfig

func (c *Core) GetCommandsConfig() error

func (*Core) GetProjectDir

func (c *Core) GetProjectDir(projectName string) common.Msg

func (*Core) GetProjectNames

func (c *Core) GetProjectNames() []string

func (*Core) GetProjects

func (c *Core) GetProjects() (Projects, error)

func (*Core) GetProjectsConfig

func (c *Core) GetProjectsConfig() error

func (*Core) Init

func (c *Core) Init() common.Msg

TODO: Handle other types of messages and send them to the CLI via events

func (*Core) ProjectExists

func (c *Core) ProjectExists(name string) (bool, Project)

func (*Core) RemoveCommand

func (c *Core) RemoveCommand(name string) common.Msg

func (*Core) RemoveCommandFromProject

func (c *Core) RemoveCommandFromProject(projectName string, commandName string) common.Msg

func (*Core) RemoveProject

func (c *Core) RemoveProject(name string) common.Msg

func (*Core) RemoveVariable

func (c *Core) RemoveVariable(name string, key string) common.Msg

func (*Core) RequireSudo

func (c *Core) RequireSudo() error

func (*Core) SetProjectDir

func (c *Core) SetProjectDir(projectName string, dir *string) common.Msg

func (*Core) TryToRun

func (c *Core) TryToRun(name string) common.Msg

type Project

type Project struct {
	Domain    string    `json:"domain"`
	Port      int       `json:"port"`
	Commands  []string  `json:"commands"`
	Dir       *string   `json:"dir"`
	Variables Variables `json:"variables"`
}

type Projects

type Projects map[string]Project

type Variables

type Variables map[string]string

Jump to

Keyboard shortcuts

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