Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterBrowserServer(s grpc.ServiceRegistrar, srv BrowserServer)
- type Back
- type BrowserClient
- type BrowserServer
- type Browser_SessionClient
- type Browser_SessionServer
- type Click
- type ClientMsg
- func (*ClientMsg) Descriptor() ([]byte, []int)deprecated
- func (x *ClientMsg) GetBack() *Back
- func (x *ClientMsg) GetClick() *Click
- func (x *ClientMsg) GetForward() *Forward
- func (x *ClientMsg) GetKey() *Key
- func (x *ClientMsg) GetMsg() isClientMsg_Msg
- func (x *ClientMsg) GetNavigate() *Navigate
- func (x *ClientMsg) GetResize() *Resize
- func (x *ClientMsg) GetScroll() *Scroll
- func (*ClientMsg) ProtoMessage()
- func (x *ClientMsg) ProtoReflect() protoreflect.Message
- func (x *ClientMsg) Reset()
- func (x *ClientMsg) String() string
- type ClientMsg_Back
- type ClientMsg_Click
- type ClientMsg_Forward
- type ClientMsg_Key
- type ClientMsg_Navigate
- type ClientMsg_Resize
- type ClientMsg_Scroll
- type Error
- type Forward
- type Frame
- func (*Frame) Descriptor() ([]byte, []int)deprecated
- func (x *Frame) GetH() int32
- func (x *Frame) GetOffsetY() int32
- func (x *Frame) GetPng() []byte
- func (x *Frame) GetW() int32
- func (*Frame) ProtoMessage()
- func (x *Frame) ProtoReflect() protoreflect.Message
- func (x *Frame) Reset()
- func (x *Frame) String() string
- type Key
- type Navigate
- type Resize
- type Scroll
- type ServerMsg
- func (*ServerMsg) Descriptor() ([]byte, []int)deprecated
- func (x *ServerMsg) GetError() *Error
- func (x *ServerMsg) GetFrame() *Frame
- func (x *ServerMsg) GetMsg() isServerMsg_Msg
- func (x *ServerMsg) GetState() *State
- func (*ServerMsg) ProtoMessage()
- func (x *ServerMsg) ProtoReflect() protoreflect.Message
- func (x *ServerMsg) Reset()
- func (x *ServerMsg) String() string
- type ServerMsg_Error
- type ServerMsg_Frame
- type ServerMsg_State
- type State
- func (*State) Descriptor() ([]byte, []int)deprecated
- func (x *State) GetCanBack() bool
- func (x *State) GetCanForward() bool
- func (x *State) GetLoading() bool
- func (x *State) GetTitle() string
- func (x *State) GetUrl() string
- func (*State) ProtoMessage()
- func (x *State) ProtoReflect() protoreflect.Message
- func (x *State) Reset()
- func (x *State) String() string
- type UnimplementedBrowserServer
- type UnsafeBrowserServer
Constants ¶
const (
Browser_Session_FullMethodName = "/browserproxy.v1.Browser/Session"
)
Variables ¶
var Browser_ServiceDesc = grpc.ServiceDesc{ ServiceName: "browserproxy.v1.Browser", HandlerType: (*BrowserServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Session", Handler: _Browser_Session_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "proto/browser.proto", }
Browser_ServiceDesc is the grpc.ServiceDesc for Browser service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_proto_browser_proto protoreflect.FileDescriptor
Functions ¶
func RegisterBrowserServer ¶
func RegisterBrowserServer(s grpc.ServiceRegistrar, srv BrowserServer)
Types ¶
type Back ¶
type Back struct {
// contains filtered or unexported fields
}
Back re-loads the most recent back-history entry.
func (*Back) Descriptor
deprecated
func (*Back) ProtoMessage ¶
func (*Back) ProtoMessage()
func (*Back) ProtoReflect ¶
func (x *Back) ProtoReflect() protoreflect.Message
type BrowserClient ¶
type BrowserClient interface {
// Session drives one tab for the lifetime of the stream.
Session(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[ClientMsg, ServerMsg], error)
}
BrowserClient is the client API for Browser service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
Browser is the remote-browser service. A single long-lived bidirectional stream models one browser tab: the client sends input events, the server streams back rendered frames and chrome state. This maps the browser's natural full-duplex interaction directly onto gRPC streaming — the transport underneath is grpc-transports/websocket, so the same client compiles to GOOS=js/wasm and runs in the browser with no sidecar proxy.
func NewBrowserClient ¶
func NewBrowserClient(cc grpc.ClientConnInterface) BrowserClient
type BrowserServer ¶
type BrowserServer interface {
// Session drives one tab for the lifetime of the stream.
Session(grpc.BidiStreamingServer[ClientMsg, ServerMsg]) error
// contains filtered or unexported methods
}
BrowserServer is the server API for Browser service. All implementations must embed UnimplementedBrowserServer for forward compatibility.
Browser is the remote-browser service. A single long-lived bidirectional stream models one browser tab: the client sends input events, the server streams back rendered frames and chrome state. This maps the browser's natural full-duplex interaction directly onto gRPC streaming — the transport underneath is grpc-transports/websocket, so the same client compiles to GOOS=js/wasm and runs in the browser with no sidecar proxy.
type Browser_SessionClient ¶
type Browser_SessionClient = grpc.BidiStreamingClient[ClientMsg, ServerMsg]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Browser_SessionServer ¶
type Browser_SessionServer = grpc.BidiStreamingServer[ClientMsg, ServerMsg]
This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type Click ¶
type Click struct {
X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"`
Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"`
// contains filtered or unexported fields
}
Click reports a content-area click in viewport pixel coordinates.
func (*Click) Descriptor
deprecated
func (*Click) ProtoMessage ¶
func (*Click) ProtoMessage()
func (*Click) ProtoReflect ¶
func (x *Click) ProtoReflect() protoreflect.Message
type ClientMsg ¶
type ClientMsg struct {
// Types that are valid to be assigned to Msg:
//
// *ClientMsg_Navigate
// *ClientMsg_Click
// *ClientMsg_Scroll
// *ClientMsg_Key
// *ClientMsg_Resize
// *ClientMsg_Back
// *ClientMsg_Forward
Msg isClientMsg_Msg `protobuf_oneof:"msg"`
// contains filtered or unexported fields
}
ClientMsg is one input event from the client. Exactly one field is set.
func (*ClientMsg) Descriptor
deprecated
func (*ClientMsg) GetForward ¶
func (*ClientMsg) GetNavigate ¶
func (*ClientMsg) ProtoMessage ¶
func (*ClientMsg) ProtoMessage()
func (*ClientMsg) ProtoReflect ¶
func (x *ClientMsg) ProtoReflect() protoreflect.Message
type ClientMsg_Back ¶
type ClientMsg_Back struct {
Back *Back `protobuf:"bytes,6,opt,name=back,proto3,oneof"`
}
type ClientMsg_Click ¶
type ClientMsg_Click struct {
Click *Click `protobuf:"bytes,2,opt,name=click,proto3,oneof"`
}
type ClientMsg_Forward ¶
type ClientMsg_Forward struct {
Forward *Forward `protobuf:"bytes,7,opt,name=forward,proto3,oneof"`
}
type ClientMsg_Key ¶
type ClientMsg_Key struct {
Key *Key `protobuf:"bytes,4,opt,name=key,proto3,oneof"`
}
type ClientMsg_Navigate ¶
type ClientMsg_Navigate struct {
}
type ClientMsg_Resize ¶
type ClientMsg_Resize struct {
Resize *Resize `protobuf:"bytes,5,opt,name=resize,proto3,oneof"`
}
type ClientMsg_Scroll ¶
type ClientMsg_Scroll struct {
Scroll *Scroll `protobuf:"bytes,3,opt,name=scroll,proto3,oneof"`
}
type Error ¶
type Error struct {
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
// contains filtered or unexported fields
}
Error reports a navigation or protocol failure the client should surface (e.g. an SSRF-blocked URL or an unreachable host).
func (*Error) Descriptor
deprecated
func (*Error) GetMessage ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type Forward ¶
type Forward struct {
// contains filtered or unexported fields
}
Forward re-loads the next forward-history entry.
func (*Forward) Descriptor
deprecated
func (*Forward) ProtoMessage ¶
func (*Forward) ProtoMessage()
func (*Forward) ProtoReflect ¶
func (x *Forward) ProtoReflect() protoreflect.Message
type Frame ¶
type Frame struct {
Png []byte `protobuf:"bytes,1,opt,name=png,proto3" json:"png,omitempty"`
W int32 `protobuf:"varint,2,opt,name=w,proto3" json:"w,omitempty"`
H int32 `protobuf:"varint,3,opt,name=h,proto3" json:"h,omitempty"`
OffsetY int32 `protobuf:"varint,4,opt,name=offset_y,json=offsetY,proto3" json:"offset_y,omitempty"`
// contains filtered or unexported fields
}
Frame is a rendered viewport slice: raw PNG bytes (no base64 — gRPC carries binary natively) taken from the full page at vertical scroll offset_y.
func (*Frame) Descriptor
deprecated
func (*Frame) GetOffsetY ¶
func (*Frame) ProtoMessage ¶
func (*Frame) ProtoMessage()
func (*Frame) ProtoReflect ¶
func (x *Frame) ProtoReflect() protoreflect.Message
type Key ¶
type Key struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
// contains filtered or unexported fields
}
Key reports a key press by name (e.g. "Enter", "ArrowDown").
func (*Key) Descriptor
deprecated
func (*Key) ProtoMessage ¶
func (*Key) ProtoMessage()
func (*Key) ProtoReflect ¶
func (x *Key) ProtoReflect() protoreflect.Message
type Navigate ¶
type Navigate struct {
// contains filtered or unexported fields
}
Navigate loads a new URL as a fresh history entry.
func (*Navigate) Descriptor
deprecated
func (*Navigate) ProtoMessage ¶
func (*Navigate) ProtoMessage()
func (*Navigate) ProtoReflect ¶
func (x *Navigate) ProtoReflect() protoreflect.Message
type Resize ¶
type Resize struct {
W int32 `protobuf:"varint,1,opt,name=w,proto3" json:"w,omitempty"`
H int32 `protobuf:"varint,2,opt,name=h,proto3" json:"h,omitempty"`
// contains filtered or unexported fields
}
Resize sets a new content-area viewport size in pixels.
func (*Resize) Descriptor
deprecated
func (*Resize) ProtoMessage ¶
func (*Resize) ProtoMessage()
func (*Resize) ProtoReflect ¶
func (x *Resize) ProtoReflect() protoreflect.Message
type Scroll ¶
type Scroll struct {
Dy int32 `protobuf:"varint,1,opt,name=dy,proto3" json:"dy,omitempty"`
// contains filtered or unexported fields
}
Scroll adjusts the vertical scroll by dy pixels (positive = down).
func (*Scroll) Descriptor
deprecated
func (*Scroll) ProtoMessage ¶
func (*Scroll) ProtoMessage()
func (*Scroll) ProtoReflect ¶
func (x *Scroll) ProtoReflect() protoreflect.Message
type ServerMsg ¶
type ServerMsg struct {
// Types that are valid to be assigned to Msg:
//
// *ServerMsg_Frame
// *ServerMsg_State
// *ServerMsg_Error
Msg isServerMsg_Msg `protobuf_oneof:"msg"`
// contains filtered or unexported fields
}
ServerMsg is one message streamed to the client. Exactly one field is set.
func (*ServerMsg) Descriptor
deprecated
func (*ServerMsg) ProtoMessage ¶
func (*ServerMsg) ProtoMessage()
func (*ServerMsg) ProtoReflect ¶
func (x *ServerMsg) ProtoReflect() protoreflect.Message
type ServerMsg_Error ¶
type ServerMsg_Error struct {
Error *Error `protobuf:"bytes,3,opt,name=error,proto3,oneof"`
}
type ServerMsg_Frame ¶
type ServerMsg_Frame struct {
Frame *Frame `protobuf:"bytes,1,opt,name=frame,proto3,oneof"`
}
type ServerMsg_State ¶
type ServerMsg_State struct {
State *State `protobuf:"bytes,2,opt,name=state,proto3,oneof"`
}
type State ¶
type State struct {
Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"`
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
Loading bool `protobuf:"varint,3,opt,name=loading,proto3" json:"loading,omitempty"`
CanBack bool `protobuf:"varint,4,opt,name=can_back,json=canBack,proto3" json:"can_back,omitempty"`
CanForward bool `protobuf:"varint,5,opt,name=can_forward,json=canForward,proto3" json:"can_forward,omitempty"`
// contains filtered or unexported fields
}
State is the browser-chrome model: what the address bar and the back/forward buttons should show.
func (*State) Descriptor
deprecated
func (*State) GetCanBack ¶
func (*State) GetCanForward ¶
func (*State) GetLoading ¶
func (*State) ProtoMessage ¶
func (*State) ProtoMessage()
func (*State) ProtoReflect ¶
func (x *State) ProtoReflect() protoreflect.Message
type UnimplementedBrowserServer ¶
type UnimplementedBrowserServer struct{}
UnimplementedBrowserServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedBrowserServer) Session ¶
func (UnimplementedBrowserServer) Session(grpc.BidiStreamingServer[ClientMsg, ServerMsg]) error
type UnsafeBrowserServer ¶
type UnsafeBrowserServer interface {
// contains filtered or unexported methods
}
UnsafeBrowserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to BrowserServer will result in compilation errors.