clienv

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANSIColorWhite  = lipgloss.Color("15")
	ANSIColorCyan   = lipgloss.Color("14")
	ANSIColorPurple = lipgloss.Color("13")
	ANSIColorBlue   = lipgloss.Color("12")
	ANSIColorYellow = lipgloss.Color("11")
	ANSIColorGreen  = lipgloss.Color("10")
	ANSIColorRed    = lipgloss.Color("9")
	ANSIColorGray   = lipgloss.Color("8")
)
View Source
const (
	IconInfo = "ℹ️"
	IconWarn = "⚠"
)

Variables

View Source
var ErrNoContent = fmt.Errorf("no content")

Functions

func Flags

func Flags() ([]cli.Flag, error)

func MarshalFile

func MarshalFile(v any, filepath string, fn func(any) ([]byte, error)) error

func PathExists

func PathExists(path string) bool

func PathStateHome

func PathStateHome() string

func Table

func Table(columns ...Column) string

func UnmarshalFile

func UnmarshalFile(filepath string, v any, f func([]byte, any) error) error

Types

type CliEnv

type CliEnv struct {
	Path *PathStructure
	// contains filtered or unexported fields
}

func FromCLI

func FromCLI(cCtx *cli.Context) *CliEnv

func New

func New(
	stdout io.Writer,
	stderr io.Writer,
	path *PathStructure,
	domain string,
	projectName string,
) *CliEnv

func (*CliEnv) Domain

func (ce *CliEnv) Domain() string

func (*CliEnv) GetAppInfo

func (ce *CliEnv) GetAppInfo(
	ctx context.Context,
	subdomain string,
) (*graphql.GetWorkspacesApps_Workspaces_Apps, error)

func (*CliEnv) GetNhostClient

func (ce *CliEnv) GetNhostClient() *nhostclient.Client

func (*CliEnv) Infoln

func (ce *CliEnv) Infoln(msg string, a ...any)

func (*CliEnv) LoadSession

func (ce *CliEnv) LoadSession(
	ctx context.Context,
) (credentials.Session, error)

func (*CliEnv) Login

func (ce *CliEnv) Login(
	ctx context.Context,
	email string,
	password string,
	pat string,
) (credentials.Credentials, error)

func (*CliEnv) Println

func (ce *CliEnv) Println(msg string, a ...any)

func (*CliEnv) ProjectName

func (ce *CliEnv) ProjectName() string

func (*CliEnv) PromptInput

func (ce *CliEnv) PromptInput(hide bool) (string, error)

func (*CliEnv) PromptMessage

func (ce *CliEnv) PromptMessage(msg string, a ...any)

func (*CliEnv) Warnln

func (ce *CliEnv) Warnln(msg string, a ...any)

type Column

type Column struct {
	Header string
	Rows   []string
}

type PathStructure

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

func NewPathStructure

func NewPathStructure(
	workingDir, root, dotNhostFolder, dataFolder, nhostFolder string,
) *PathStructure

func (PathStructure) AuthFile

func (p PathStructure) AuthFile() string

func (PathStructure) DataFolder

func (p PathStructure) DataFolder() string

func (PathStructure) DockerCompose

func (p PathStructure) DockerCompose() string

func (PathStructure) DotNhostFolder

func (p PathStructure) DotNhostFolder() string

func (PathStructure) HasuraConfig

func (p PathStructure) HasuraConfig() string

func (PathStructure) NhostFolder

func (p PathStructure) NhostFolder() string

func (PathStructure) NhostToml

func (p PathStructure) NhostToml() string

func (PathStructure) Overlay added in v1.1.0

func (p PathStructure) Overlay(subdomain string) string

func (PathStructure) OverlaysFolder added in v1.1.0

func (p PathStructure) OverlaysFolder() string

func (PathStructure) ProjectFile

func (p PathStructure) ProjectFile() string

func (PathStructure) Root

func (p PathStructure) Root() string

func (PathStructure) Secrets

func (p PathStructure) Secrets() string

func (PathStructure) WorkingDir added in v1.0.1

func (p PathStructure) WorkingDir() string

Jump to

Keyboard shortcuts

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