portal

package
v0.0.0-...-3e59879 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const Name = portal.Name

Variables

View Source
var Request = rpc.NewRequest(id.Anyone, name)

Functions

func CmdCtx

func CmdCtx(ctx context.Context, args ...string) *exec.Cmd

func Executable

func Executable() string

func ResolveAppByNameOrPackage

func ResolveAppByNameOrPackage(src string) (app target.App, err error)

func ResolveApps

func ResolveApps(src string) (apps target.Portals[target.App], err error)

func ResolveAppsByPath

func ResolveAppsByPath(src string) (apps target.Portals[target.App], err error)

func ResolvePortals

func ResolvePortals(src string) (portals target.Portals[target.Portal], err error)

func ResolveProjects

func ResolveProjects(src string) (apps target.Portals[target.Project], err error)

func Spawn

func Spawn[T target.Portal](
	wg *sync.WaitGroup,
	ctx context.Context,
	apps target.Portals[T],
	action string,
) (err error)

func SrvOpenCtx

func SrvOpenCtx(ctx context.Context, src ...string) (err error)

func SrvOpenerCtx

func SrvOpenerCtx(prefix ...string) func(ctx context.Context) (open func(src string), err error)

Types

type CmdOpener

type CmdOpener[T target.Portal] struct {
	Resolve[T]
	// contains filtered or unexported fields
}

func NewCmdOpener

func NewCmdOpener[T target.Portal](resolve Resolve[T], action string) *CmdOpener[T]

func (CmdOpener[T]) Open

func (o CmdOpener[T]) Open(ctx context.Context) func(src string, background bool) error

type Resolve

type Resolve[T target.Portal] func(src string) (apps target.Portals[T], err error)

type Runner

type Runner[T target.Portal] struct {
	runtime.New
	runtime.Tray
	runtime.Serve
	runtime.Attach[T]
	runtime.Resolve[T]
	rpc.Handlers
	Action  string
	Port    string
	Request rpc.Conn
}

func (Runner[T]) Await

func (r Runner[T]) Await(duration time.Duration) (err error)

func (Runner[T]) Ping

func (r Runner[T]) Ping() (err error)

func (Runner[T]) Run

func (r Runner[T]) Run(
	ctx context.Context,
	src string,
	attach bool,
) (err error)

Jump to

Keyboard shortcuts

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