Help us shape the future of Go! Take the 2026 Go Developer Survey

dev

package
v0.0.137 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdErr ioType = iota
	Stdout
)

Variables

This section is empty.

Functions

func CreateRunProjectCmd

func CreateRunProjectCmd(ctx context.Context, log logger.Logger, theproject project.ProjectContext, server *Server, dir string, orgId string, port int, stdout io.Writer, stderr io.Writer) (*exec.Cmd, error)

func FindAvailablePort added in v0.0.74

func FindAvailablePort(p project.ProjectContext, tryPort int) (int, error)

func KillProjectServer added in v0.0.72

func KillProjectServer(logger logger.Logger, projectServerCmd *exec.Cmd, pid int)

Types

type Agent

type Agent struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	LocalURL    string `json:"local_url,omitempty"`
	PublicURL   string `json:"public_url,omitempty"`
}

type AgentWelcome added in v0.0.124

type AgentWelcome struct {
	project.AgentConfig
	Welcome
}

type AgentsControlResponse added in v0.0.122

type AgentsControlResponse struct {
	ProjectID   string         `json:"projectId"`
	ProjectName string         `json:"projectName"`
	Agents      []AgentWelcome `json:"agents"`
}

type ConnectionResponse added in v0.0.122

type ConnectionResponse struct {
	Success bool   `json:"success"`
	Error   string `json:"message"`
	Data    struct {
		Certificate     string `json:"certificate"`
		PrivateKey      string `json:"private_key"`
		Domain          string `json:"domain"`
		ExpiresAt       string `json:"expires_at"`
		OtelUrl         string `json:"otlp_url"`
		OtelBearerToken string `json:"otlp_token"`
		Hostname        string `json:"hostname,omitempty"`
	} `json:"data"`
}

type DevModeConfig added in v0.0.122

type DevModeConfig struct {
	DevModeUrl string
	PublicUrl  string
	AppUrl     string
	Agents     []*Agent
}

type DevModeUI added in v0.0.122

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

func NewDevModeUI added in v0.0.122

func NewDevModeUI(ctx context.Context, config DevModeConfig) *DevModeUI

func (*DevModeUI) AddErrorLog added in v0.0.133

func (d *DevModeUI) AddErrorLog(log string, args ...any)

Add an error log message to the log list

func (*DevModeUI) AddLog added in v0.0.122

func (d *DevModeUI) AddLog(severity logger.LogLevel, log string, args ...any)

Add a log message to the log list

func (*DevModeUI) Close added in v0.0.122

func (d *DevModeUI) Close(abort bool)

Close the program which will stop the program and wait for it to exit

func (*DevModeUI) Done added in v0.0.122

func (d *DevModeUI) Done() <-chan struct{}

Done returns a channel that will be closed when the program is done

func (*DevModeUI) SetPublicURL added in v0.0.122

func (d *DevModeUI) SetPublicURL(url string)

func (*DevModeUI) SetSpinner added in v0.0.122

func (d *DevModeUI) SetSpinner(spinning bool)

func (*DevModeUI) SetStatusMessage added in v0.0.122

func (d *DevModeUI) SetStatusMessage(msg string, args ...any)

func (*DevModeUI) ShowSpinner added in v0.0.122

func (d *DevModeUI) ShowSpinner(msg string, fn func())

func (*DevModeUI) Start added in v0.0.122

func (d *DevModeUI) Start()

Start the program

type FileWatcher

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

func NewWatcher

func NewWatcher(logger logger.Logger, dir string, patterns []string, callback func(string)) (*FileWatcher, error)

func (*FileWatcher) Close

func (fw *FileWatcher) Close(logger logger.Logger) error

type PendingLogger added in v0.0.122

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

func NewPendingLogger added in v0.0.122

func NewPendingLogger(logLevel logger.LogLevel) *PendingLogger

func (*PendingLogger) Debug added in v0.0.122

func (l *PendingLogger) Debug(msg string, args ...interface{})

Debug level logging

func (*PendingLogger) Error added in v0.0.122

func (l *PendingLogger) Error(msg string, args ...interface{})

Error level logging

func (*PendingLogger) Fatal added in v0.0.122

func (l *PendingLogger) Fatal(msg string, args ...interface{})

Fatal level logging and exit with code 1

func (*PendingLogger) Info added in v0.0.122

func (l *PendingLogger) Info(msg string, args ...interface{})

Info level loggi ng

func (*PendingLogger) Stack added in v0.0.122

func (l *PendingLogger) Stack(next logger.Logger) logger.Logger

Stack will return a new logger that logs to the given logger as well as the current logger

func (*PendingLogger) Trace added in v0.0.122

func (l *PendingLogger) Trace(msg string, args ...interface{})

Trace level logging

func (*PendingLogger) Warn added in v0.0.122

func (l *PendingLogger) Warn(msg string, args ...interface{})

Warning level logging

func (*PendingLogger) With added in v0.0.122

func (l *PendingLogger) With(metadata map[string]interface{}) logger.Logger

With will return a new logger using metadata as the base context

func (*PendingLogger) WithContext added in v0.0.122

func (l *PendingLogger) WithContext(ctx context.Context) logger.Logger

WithContext will return a new logger with the given context

func (*PendingLogger) WithPrefix added in v0.0.122

func (l *PendingLogger) WithPrefix(prefix string) logger.Logger

WithPrefix will return a new logger with a prefix prepended to the message

type Server added in v0.0.122

type Server struct {
	ID string

	Project project.ProjectContext
	// contains filtered or unexported fields
}

func New added in v0.0.122

func New(args ServerArgs) (*Server, error)

func (*Server) AgentURL added in v0.0.122

func (s *Server) AgentURL(agentId string) string

func (*Server) Close added in v0.0.122

func (s *Server) Close() error

Close closes the bridge client and cleans up the connection

func (*Server) Connect added in v0.0.122

func (s *Server) Connect(ui *DevModeUI, tuiLogger logger.Logger, tuiLoggerErr logger.Logger) error

func (*Server) HealthCheck added in v0.0.122

func (s *Server) HealthCheck(devModeUrl string) error

func (*Server) PublicURL added in v0.0.122

func (s *Server) PublicURL(appUrl string) string

func (*Server) WebURL added in v0.0.122

func (s *Server) WebURL(appUrl string) string

type ServerArgs added in v0.0.122

type ServerArgs struct {
	Ctx          context.Context
	Logger       logger.Logger
	LogLevel     logger.LogLevel
	APIURL       string
	TransportURL string
	APIKey       string
	Project      project.ProjectContext
	OrgId        string
	UserId       string
	Version      string
	Port         int
}

type TuiLogger added in v0.0.122

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

func NewTUILogger added in v0.0.122

func NewTUILogger(logLevel logger.LogLevel, ui *DevModeUI, ioType ioType) *TuiLogger

func (*TuiLogger) Debug added in v0.0.122

func (l *TuiLogger) Debug(msg string, args ...interface{})

Debug level logging

func (*TuiLogger) Error added in v0.0.122

func (l *TuiLogger) Error(msg string, args ...interface{})

Error level logging

func (*TuiLogger) Fatal added in v0.0.122

func (l *TuiLogger) Fatal(msg string, args ...interface{})

Fatal level logging and exit with code 1

func (*TuiLogger) Info added in v0.0.122

func (l *TuiLogger) Info(msg string, args ...interface{})

Info level loggi ng

func (*TuiLogger) Stack added in v0.0.122

func (l *TuiLogger) Stack(next logger.Logger) logger.Logger

Stack will return a new logger that logs to the given logger as well as the current logger

func (*TuiLogger) Trace added in v0.0.122

func (l *TuiLogger) Trace(msg string, args ...interface{})

Trace level logging

func (*TuiLogger) Warn added in v0.0.122

func (l *TuiLogger) Warn(msg string, args ...interface{})

Warning level logging

func (*TuiLogger) With added in v0.0.122

func (l *TuiLogger) With(metadata map[string]interface{}) logger.Logger

With will return a new logger using metadata as the base context

func (*TuiLogger) WithContext added in v0.0.122

func (l *TuiLogger) WithContext(ctx context.Context) logger.Logger

WithContext will return a new logger with the given context

func (*TuiLogger) WithPrefix added in v0.0.122

func (l *TuiLogger) WithPrefix(prefix string) logger.Logger

WithPrefix will return a new logger with a prefix prepended to the message

func (*TuiLogger) Write added in v0.0.122

func (l *TuiLogger) Write(p []byte) (n int, err error)

type Welcome added in v0.0.86

type Welcome struct {
	Message string `json:"welcome"`
	Prompts []struct {
		Data        string `json:"data"`
		ContentType string `json:"contentType"`
	} `json:"prompts,omitempty"`
}

Jump to

Keyboard shortcuts

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