devsession

package
v0.0.336 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebPackage schema.PackageName = "namespacelabs.dev/foundation/internal/webui/devui"
)

Variables

View Source
var File_internal_devsession_types_proto protoreflect.FileDescriptor

Functions

func NewPortFwd

func NewPortFwd(ctx context.Context, obs *Session, env cfg.Context, rt runtime.ClusterNamespace, localaddr string) *portforward.PortForward

func PrebuiltWebUI

func PrebuiltWebUI(ctx context.Context) (*mux.Router, error)

func RegisterEndpoints

func RegisterEndpoints(s *Session, r *mux.Router)

func RegisterSomeEndpoints added in v0.0.157

func RegisterSomeEndpoints(s sessionLike, r *mux.Router)

Types

type DevWorkflowRequest

type DevWorkflowRequest struct {

	// Types that are assignable to Type:
	//	*DevWorkflowRequest_SetWorkspace_
	//	*DevWorkflowRequest_ReloadWorkspace
	Type isDevWorkflowRequest_Type `protobuf_oneof:"type"`
	// contains filtered or unexported fields
}

func (*DevWorkflowRequest) Descriptor deprecated

func (*DevWorkflowRequest) Descriptor() ([]byte, []int)

Deprecated: Use DevWorkflowRequest.ProtoReflect.Descriptor instead.

func (*DevWorkflowRequest) GetReloadWorkspace

func (x *DevWorkflowRequest) GetReloadWorkspace() bool

func (*DevWorkflowRequest) GetSetWorkspace

func (*DevWorkflowRequest) GetType

func (m *DevWorkflowRequest) GetType() isDevWorkflowRequest_Type

func (*DevWorkflowRequest) ProtoMessage

func (*DevWorkflowRequest) ProtoMessage()

func (*DevWorkflowRequest) ProtoReflect

func (x *DevWorkflowRequest) ProtoReflect() protoreflect.Message

func (*DevWorkflowRequest) Reset

func (x *DevWorkflowRequest) Reset()

func (*DevWorkflowRequest) String

func (x *DevWorkflowRequest) String() string

type DevWorkflowRequest_ReloadWorkspace

type DevWorkflowRequest_ReloadWorkspace struct {
	ReloadWorkspace bool `protobuf:"varint,2,opt,name=reload_workspace,json=reloadWorkspace,proto3,oneof"`
}

type DevWorkflowRequest_SetWorkspace

type DevWorkflowRequest_SetWorkspace struct {
	AbsRoot     string `protobuf:"bytes,1,opt,name=abs_root,json=absRoot,proto3" json:"abs_root,omitempty"`
	PackageName string `protobuf:"bytes,2,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"`
	EnvName     string `protobuf:"bytes,3,opt,name=env_name,json=envName,proto3" json:"env_name,omitempty"`
	// XXX this needs more appropriate modeling.
	AdditionalServers []string `protobuf:"bytes,4,rep,name=additional_servers,json=additionalServers,proto3" json:"additional_servers,omitempty"`
	// contains filtered or unexported fields
}

func (*DevWorkflowRequest_SetWorkspace) Descriptor deprecated

func (*DevWorkflowRequest_SetWorkspace) Descriptor() ([]byte, []int)

Deprecated: Use DevWorkflowRequest_SetWorkspace.ProtoReflect.Descriptor instead.

func (*DevWorkflowRequest_SetWorkspace) GetAbsRoot

func (x *DevWorkflowRequest_SetWorkspace) GetAbsRoot() string

func (*DevWorkflowRequest_SetWorkspace) GetAdditionalServers

func (x *DevWorkflowRequest_SetWorkspace) GetAdditionalServers() []string

func (*DevWorkflowRequest_SetWorkspace) GetEnvName

func (x *DevWorkflowRequest_SetWorkspace) GetEnvName() string

func (*DevWorkflowRequest_SetWorkspace) GetPackageName

func (x *DevWorkflowRequest_SetWorkspace) GetPackageName() string

func (*DevWorkflowRequest_SetWorkspace) ProtoMessage

func (*DevWorkflowRequest_SetWorkspace) ProtoMessage()

func (*DevWorkflowRequest_SetWorkspace) ProtoReflect

func (*DevWorkflowRequest_SetWorkspace) Reset

func (*DevWorkflowRequest_SetWorkspace) String

type DevWorkflowRequest_SetWorkspace_

type DevWorkflowRequest_SetWorkspace_ struct {
	SetWorkspace *DevWorkflowRequest_SetWorkspace `protobuf:"bytes,1,opt,name=set_workspace,json=setWorkspace,proto3,oneof"`
}

type ForwardedPort

type ForwardedPort struct {
	Endpoint      *schema.Endpoint `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"`
	LocalPort     int32            `protobuf:"varint,2,opt,name=local_port,json=localPort,proto3" json:"local_port,omitempty"`
	ContainerPort int32            `protobuf:"varint,3,opt,name=container_port,json=containerPort,proto3" json:"container_port,omitempty"`
	Error         string           `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"`
	// contains filtered or unexported fields
}

func (*ForwardedPort) Descriptor deprecated

func (*ForwardedPort) Descriptor() ([]byte, []int)

Deprecated: Use ForwardedPort.ProtoReflect.Descriptor instead.

func (*ForwardedPort) GetContainerPort

func (x *ForwardedPort) GetContainerPort() int32

func (*ForwardedPort) GetEndpoint

func (x *ForwardedPort) GetEndpoint() *schema.Endpoint

func (*ForwardedPort) GetError

func (x *ForwardedPort) GetError() string

func (*ForwardedPort) GetLocalPort

func (x *ForwardedPort) GetLocalPort() int32

func (*ForwardedPort) ProtoMessage

func (*ForwardedPort) ProtoMessage()

func (*ForwardedPort) ProtoReflect

func (x *ForwardedPort) ProtoReflect() protoreflect.Message

func (*ForwardedPort) Reset

func (x *ForwardedPort) Reset()

func (*ForwardedPort) String

func (x *ForwardedPort) String() string

type Observer

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

func (*Observer) Close

func (o *Observer) Close()

func (*Observer) Events

func (o *Observer) Events() chan *Update

func (*Observer) StackEvents

func (o *Observer) StackEvents() chan *observers.StackUpdateEvent

type ObserverLike added in v0.0.157

type ObserverLike interface {
	Events() chan *Update
	Close()
}

type Observers

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

func NewObservers

func NewObservers() *Observers

func (*Observers) Close

func (obs *Observers) Close()

func (*Observers) New

func (obs *Observers) New(initial *Update, stackUpdates bool) (*Observer, error)

func (*Observers) Publish

func (obs *Observers) Publish(data *Update)

type Session

type Session struct {
	Errors io.Writer
	// contains filtered or unexported fields
}

func NewSession

func NewSession(errorLog io.Writer, sink *tasks.StatefulSink, localHostname string, envs []*schema.Environment) (*Session, error)

func (*Session) BuildJSONOutput

func (s *Session) BuildJSONOutput() io.ReadCloser

func (*Session) BuildOutput

func (s *Session) BuildOutput() io.ReadCloser

func (*Session) CommandOutput

func (s *Session) CommandOutput() io.ReadCloser

XXX these need to be re-implemented.

func (*Session) DeferRequest

func (s *Session) DeferRequest(req *DevWorkflowRequest)

func (*Session) NewClient

func (s *Session) NewClient(needsHistory bool) (ObserverLike, error)

func (*Session) NewStackClient

func (s *Session) NewStackClient() (observers.StackSession, error)

Implements observers.SessionProvider.

func (*Session) ResolveServer

func (s *Session) ResolveServer(ctx context.Context, serverID string) (runtime.ClusterNamespace, runtime.Deployable, error)

func (*Session) Run

func (s *Session) Run(ctx context.Context, extra func(*executor.Executor)) error

func (*Session) TaskLogByName

func (s *Session) TaskLogByName(taskID, name string) io.ReadCloser

type Stack

type Stack struct {
	Revision      uint64                `protobuf:"varint,9,opt,name=revision,proto3" json:"revision,omitempty"`
	AbsRoot       string                `protobuf:"bytes,1,opt,name=abs_root,json=absRoot,proto3" json:"abs_root,omitempty"`
	Workspace     *schema.Workspace     `protobuf:"bytes,2,opt,name=workspace,proto3" json:"workspace,omitempty"`
	Env           *schema.Environment   `protobuf:"bytes,3,opt,name=env,proto3" json:"env,omitempty"`
	AvailableEnv  []*schema.Environment `protobuf:"bytes,8,rep,name=available_env,json=availableEnv,proto3" json:"available_env,omitempty"`
	Stack         *schema.Stack         `protobuf:"bytes,4,opt,name=stack,proto3" json:"stack,omitempty"`
	Current       *schema.Stack_Entry   `protobuf:"bytes,5,opt,name=current,proto3" json:"current,omitempty"`
	Focus         []string              `protobuf:"bytes,11,rep,name=focus,proto3" json:"focus,omitempty"`
	State         []*StackEntryState    `protobuf:"bytes,6,rep,name=state,proto3" json:"state,omitempty"`
	ForwardedPort []*ForwardedPort      `protobuf:"bytes,7,rep,name=forwarded_port,json=forwardedPort,proto3" json:"forwarded_port,omitempty"`
	// Pre-rendered "network_plan" as text. Contains ANSI color codes.
	// TODO: remove and use native Web rendering.
	RenderedPortForwarding string               `` /* 130-byte string literal not displayed */
	NetworkPlan            *storage.NetworkPlan `protobuf:"bytes,12,opt,name=network_plan,json=networkPlan,proto3" json:"network_plan,omitempty"`
	Deployed               bool                 `protobuf:"varint,13,opt,name=deployed,proto3" json:"deployed,omitempty"`
	DeploymentRevision     uint64               `protobuf:"varint,14,opt,name=deployment_revision,json=deploymentRevision,proto3" json:"deployment_revision,omitempty"` // Every time that we see a deployment event, we increment the deployment_revision.
	// contains filtered or unexported fields
}

Next ID: 13

func (*Stack) Descriptor deprecated

func (*Stack) Descriptor() ([]byte, []int)

Deprecated: Use Stack.ProtoReflect.Descriptor instead.

func (*Stack) GetAbsRoot

func (x *Stack) GetAbsRoot() string

func (*Stack) GetAvailableEnv

func (x *Stack) GetAvailableEnv() []*schema.Environment

func (*Stack) GetCurrent

func (x *Stack) GetCurrent() *schema.Stack_Entry

func (*Stack) GetDeployed added in v0.0.81

func (x *Stack) GetDeployed() bool

func (*Stack) GetDeploymentRevision added in v0.0.82

func (x *Stack) GetDeploymentRevision() uint64

func (*Stack) GetEnv

func (x *Stack) GetEnv() *schema.Environment

func (*Stack) GetFocus

func (x *Stack) GetFocus() []string

func (*Stack) GetForwardedPort

func (x *Stack) GetForwardedPort() []*ForwardedPort

func (*Stack) GetNetworkPlan

func (x *Stack) GetNetworkPlan() *storage.NetworkPlan

func (*Stack) GetRenderedPortForwarding

func (x *Stack) GetRenderedPortForwarding() string

func (*Stack) GetRevision

func (x *Stack) GetRevision() uint64

func (*Stack) GetStack

func (x *Stack) GetStack() *schema.Stack

func (*Stack) GetState

func (x *Stack) GetState() []*StackEntryState

func (*Stack) GetWorkspace

func (x *Stack) GetWorkspace() *schema.Workspace

func (*Stack) ProtoMessage

func (*Stack) ProtoMessage()

func (*Stack) ProtoReflect

func (x *Stack) ProtoReflect() protoreflect.Message

func (*Stack) Reset

func (x *Stack) Reset()

func (*Stack) String

func (x *Stack) String() string

type StackEntryState

type StackEntryState struct {
	PackageName string `protobuf:"bytes,1,opt,name=package_name,json=packageName,proto3" json:"package_name,omitempty"`
	LastError   string `protobuf:"bytes,2,opt,name=last_error,json=lastError,proto3" json:"last_error,omitempty"`
	// contains filtered or unexported fields
}

func (*StackEntryState) Descriptor deprecated

func (*StackEntryState) Descriptor() ([]byte, []int)

Deprecated: Use StackEntryState.ProtoReflect.Descriptor instead.

func (*StackEntryState) GetLastError

func (x *StackEntryState) GetLastError() string

func (*StackEntryState) GetPackageName

func (x *StackEntryState) GetPackageName() string

func (*StackEntryState) ProtoMessage

func (*StackEntryState) ProtoMessage()

func (*StackEntryState) ProtoReflect

func (x *StackEntryState) ProtoReflect() protoreflect.Message

func (*StackEntryState) Reset

func (x *StackEntryState) Reset()

func (*StackEntryState) String

func (x *StackEntryState) String() string

type TerminalInput

type TerminalInput struct {
	Stdin  []byte                      `protobuf:"bytes,1,opt,name=stdin,proto3" json:"stdin,omitempty"`
	Resize *TerminalInput_WindowResize `protobuf:"bytes,2,opt,name=resize,proto3" json:"resize,omitempty"`
	// contains filtered or unexported fields
}

func (*TerminalInput) Descriptor deprecated

func (*TerminalInput) Descriptor() ([]byte, []int)

Deprecated: Use TerminalInput.ProtoReflect.Descriptor instead.

func (*TerminalInput) GetResize

func (x *TerminalInput) GetResize() *TerminalInput_WindowResize

func (*TerminalInput) GetStdin

func (x *TerminalInput) GetStdin() []byte

func (*TerminalInput) ProtoMessage

func (*TerminalInput) ProtoMessage()

func (*TerminalInput) ProtoReflect

func (x *TerminalInput) ProtoReflect() protoreflect.Message

func (*TerminalInput) Reset

func (x *TerminalInput) Reset()

func (*TerminalInput) String

func (x *TerminalInput) String() string

type TerminalInput_WindowResize

type TerminalInput_WindowResize struct {
	Width  uint32 `protobuf:"varint,1,opt,name=width,proto3" json:"width,omitempty"`
	Height uint32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

func (*TerminalInput_WindowResize) Descriptor deprecated

func (*TerminalInput_WindowResize) Descriptor() ([]byte, []int)

Deprecated: Use TerminalInput_WindowResize.ProtoReflect.Descriptor instead.

func (*TerminalInput_WindowResize) GetHeight

func (x *TerminalInput_WindowResize) GetHeight() uint32

func (*TerminalInput_WindowResize) GetWidth

func (x *TerminalInput_WindowResize) GetWidth() uint32

func (*TerminalInput_WindowResize) ProtoMessage

func (*TerminalInput_WindowResize) ProtoMessage()

func (*TerminalInput_WindowResize) ProtoReflect

func (*TerminalInput_WindowResize) Reset

func (x *TerminalInput_WindowResize) Reset()

func (*TerminalInput_WindowResize) String

func (x *TerminalInput_WindowResize) String() string

type Update

type Update struct {
	StackUpdate *Stack           `protobuf:"bytes,1,opt,name=stack_update,json=stackUpdate,proto3" json:"stack_update,omitempty"`
	TaskUpdate  []*protocol.Task `protobuf:"bytes,2,rep,name=task_update,json=taskUpdate,proto3" json:"task_update,omitempty"`
	// contains filtered or unexported fields
}

func (*Update) Descriptor deprecated

func (*Update) Descriptor() ([]byte, []int)

Deprecated: Use Update.ProtoReflect.Descriptor instead.

func (*Update) GetStackUpdate

func (x *Update) GetStackUpdate() *Stack

func (*Update) GetTaskUpdate

func (x *Update) GetTaskUpdate() []*protocol.Task

func (*Update) ProtoMessage

func (*Update) ProtoMessage()

func (*Update) ProtoReflect

func (x *Update) ProtoReflect() protoreflect.Message

func (*Update) Reset

func (x *Update) Reset()

func (*Update) String

func (x *Update) String() string

Jump to

Keyboard shortcuts

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