Documentation
¶
Index ¶
- Constants
- Variables
- func AddAdmin(db *sql.DB, username, firstName, lastName, email, password string) error
- func AddGroup(db *sql.DB, groupName string) error
- func AddUser(db *sql.DB, username, firstName, lastName, email, password string) error
- func AddUserToGroup(db *sql.DB, username, groupName string, owner bool) error
- func ChangePassword(db *sql.DB, username, newPassword string) error
- func Cyan(s string) string
- func DoesUserHaveAccess(db *sql.DB, username, serviceName string) (bool, error)
- func DropTables(db *sql.DB)
- func GetDriverOptions() string
- func GetGroupsOfService(db *sql.DB, serviceName string) (string, error)
- func GetGroupsOfUser(db *sql.DB, username string, ownGroups bool) (string, error)
- func GetServicesOfGroup(db *sql.DB, groupName string) (string, error)
- func GetServicesOfUser(db *sql.DB, username string, ownServices bool) (string, error)
- func GetSortedDrivers() []string
- func GetUsersOfGroup(db *sql.DB, groupName string) (string, error)
- func GetUsersOfService(db *sql.DB, serviceName string) (string, error)
- func GetdB(driverAsPipefishEnum, hostpath string, port int, ...) (*sql.DB, error)
- func Green(s string) string
- func IsUserAdmin(db *sql.DB, username string) (bool, error)
- func IsUserGroupOwner(db *sql.DB, username, groupName string) error
- func IsUserInGroup(db *sql.DB, username, groupName string) (bool, error)
- func LetGroupUseService(db *sql.DB, groupName, serviceName string) error
- func LetUserOwnGroup(db *sql.DB, username, groupName string) error
- func Logo() string
- func MakePassword() string
- func ReadChar() rune
- func Red(s string) string
- func ServiceDo(serviceToUse *pf.Service, line string) pf.Value
- func StartServiceFromCli()
- func UnAddUserToGroup(db *sql.DB, username, groupName string) error
- func UnLetGroupUseService(db *sql.DB, groupName, serviceName string) error
- func UnLetUserOwnGroup(db *sql.DB, username, groupName string) error
- func ValidateEmail(db *sql.DB, username, email string) error
- func ValidateUser(db *sql.DB, username, password string) error
- type Hub
- func (hub *Hub) CurrentServiceIsBroken() bool
- func (hub *Hub) Do(line, username, password, passedServiceName string, external bool) (string, bool)
- func (hub *Hub) DoHubCommand(line string)
- func (hub *Hub) GetAndReportErrors(sv *pf.Service)
- func (hub *Hub) GetPretty(s string) string
- func (h *Hub) MakeFilepath(scriptFilepath string) string
- func (h *Hub) OpenHubFile(hubFilepath string)
- func (hub *Hub) Quit()
- func (hub *Hub) Repl()
- func (hub *Hub) SaveAndPropagateHubStore()
- func (hub *Hub) StartAndMakeCurrent(username, serviceName, scriptFilepath string) bool
- func (h *Hub) StartHttp(args []string, isHttps bool)
- func (hub *Hub) WriteError(s string)
- func (hub *Hub) WritePretty(s string)
- func (hub *Hub) WriteString(s string)
- type SQLDriver
Constants ¶
View Source
const HELP = "\nUsage: pipefish [-v | --version] [-h | --help]\n" +
" <command> [args]\n\n" +
"Commands are:\n\n" +
" tui Starts the Pipfish TUI (text user interface).\n" +
" run <file> Runs a Pipefish script if it has a `main` command.\n\n"
Variables ¶
View Source
var ( MARGIN = 92 GREEN_OK = ("\033[32mOK\033[0m") WAS = Green("was") + ": " GOT = Red("got") + ": " TEST_PASSED = Green("Test passed!") + "\n" VERSION = "0.6.8" BULLET = " ▪ " BULLET_SPACING = " " // I.e. whitespace the same width as BULLET. GOOD_BULLET = Green(" ▪ ") BROKEN = Red(" ✖ ") PROMPT = "→ " INDENT_PROMPT = " " ERROR = text.ERROR RT_ERROR = text.ERROR HUB_ERROR = "<R>Hub error</>: " )
View Source
var SqlDrivers = []string{"postgres", "firebirdsql", "mysql", "sqlserver", "mysql",
"oracle", "postgres", "snowflake", "sqlite", "mysql"}
Matches with the enum above, e.g. COCKROACH_DB uses the postgres driver.
Functions ¶
func DoesUserHaveAccess ¶
func DropTables ¶
func GetDriverOptions ¶
func GetDriverOptions() string
func GetGroupsOfUser ¶
func GetServicesOfUser ¶
func GetSortedDrivers ¶
func GetSortedDrivers() []string
func MakePassword ¶
func MakePassword() string
func StartServiceFromCli ¶
func StartServiceFromCli()
func UnLetGroupUseService ¶
Types ¶
type Hub ¶
type Hub struct {
Services map[string]*pf.Service // The services the hub knows about.
Out io.Writer
Sources map[string][]string
Db *sql.DB
// The username and password of the person logged into the terminal.
TerminalUsername string
TerminalPassword string
// contains filtered or unexported fields
}
func (*Hub) CurrentServiceIsBroken ¶
func (*Hub) Do ¶
func (hub *Hub) Do(line, username, password, passedServiceName string, external bool) (string, bool)
This takes the input from the REPL, interprets it as a hub command if it begins with 'hub'; as an instruction to the os if it begins with 'os', and as an expression to be passed to the current service if none of the above hold.
func (*Hub) DoHubCommand ¶
func (*Hub) GetAndReportErrors ¶
func (*Hub) MakeFilepath ¶
func (*Hub) OpenHubFile ¶
func (*Hub) SaveAndPropagateHubStore ¶
func (hub *Hub) SaveAndPropagateHubStore()
func (*Hub) StartAndMakeCurrent ¶
func (*Hub) WriteError ¶
func (*Hub) WritePretty ¶
func (*Hub) WriteString ¶
Click to show internal directories.
Click to hide internal directories.