Documentation ¶
Overview ¶
Package vsrpc provides the RPC server that Visual Studio uses to interact with azd programmatically.
The RPC server is implemented using JSON-RPC 2.0 over WebSockets.
Index ¶
- Constants
- type AspireHost
- type DeleteMode
- type DeploymentResult
- type Environment
- type EnvironmentInfo
- type Handler
- func HandlerAction0(f func(context.Context) error) Handler
- func HandlerAction1[T1 any](f func(context.Context, T1) error) Handler
- func HandlerAction2[T1 any, T2 any](f func(context.Context, T1, T2) error) Handler
- func HandlerAction3[T1 any, T2 any, T3 any](f func(context.Context, T1, T2, T3) error) Handler
- func HandlerFunc0[TRet any](f func(context.Context) (TRet, error)) Handler
- func HandlerFunc1[T1 any, TRet any](f func(context.Context, T1) (TRet, error)) Handler
- func HandlerFunc2[T1 any, T2 any, TRet any](f func(context.Context, T1, T2) (TRet, error)) Handler
- func HandlerFunc3[T1 any, T2 any, T3 any, TRet any](f func(context.Context, T1, T2, T3) (TRet, error)) Handler
- func HandlerFunc4[T1 any, T2 any, T3 any, T4 any, TRet any](f func(context.Context, T1, T2, T3, T4) (TRet, error)) Handler
- type IObserver
- type InitializeServerOptions
- type MessageKind
- type MessageSeverity
- type ProgressMessage
- type RequestContext
- type Resource
- type Server
- type Service
- type Session
Constants ¶
const ( DeleteModeLocal = 1 << iota DeleteModeAzureResources )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AspireHost ¶
type DeleteMode ¶
type DeleteMode uint32
type DeploymentResult ¶
type Environment ¶
type EnvironmentInfo ¶
type Handler ¶
type Handler func(ctx context.Context, conn jsonrpc2.Conn, reply jsonrpc2.Replier, req jsonrpc2.Request) error
Handler is the type of function that handles incoming RPC requests.
func HandlerAction0 ¶
HandlerAction0 is a helper for creating a Handler from a function that takes no arguments and returns an error.
func HandlerAction1 ¶
HandlerAction1 is a helper for creating a Handler from a function that takes one argument and returns an error.
func HandlerAction2 ¶
HandlerAction2 is a helper for creating a Handler from a function that takes two arguments and returns an error.
func HandlerAction3 ¶
HandlerAction3 is a helper for creating a Handler from a function that takes two arguments and returns an error.
func HandlerFunc0 ¶
HandlerFunc0 is a helper for creating a Handler from a function that takes no arguments and returns a value and an error.
func HandlerFunc1 ¶
HandlerFunc1 is a helper for creating a Handler from a function that takes one argument and returns a value and an error.
func HandlerFunc2 ¶
HandlerFunc2 is a helper for creating a Handler from a function that takes two arguments and returns a value and an error.
type IObserver ¶
type IObserver[T any] struct { // contains filtered or unexported fields }
IObserver is treated special by our JSON-RPC implementation and plays nicely with StreamJsonRpc's ideas on how to marshal an IObserver<T> in .NET.
The way this works is that that we can send a notification back to to the server with the method `$/invokeProxy/{handle}/{onCompleted|onNext}`. When marshalled as an argument, the wire format of IObserver<T> is:
{ "__jsonrpc_marshaled": 1, "handle": <some-integer> }
func (*IObserver[T]) UnmarshalJSON ¶
type InitializeServerOptions ¶
type InitializeServerOptions struct { // When non nil, AuthenticationEndpoint is the endpoint to connect to for authentication. It is in the same form as // expected by the AZD_AUTH_ENDPOINT environment variable. Note that both AuthenticationEndpoint and AuthenticationKey // need to be set for external authentication to be used. AuthenticationEndpoint *string `json:",omitempty"` // When non nil, AuthenticationKey is the key to use for authenticating to the server. It is in the same form as // expected by the AZD_AUTH_KEY environment variable. Note that both AuthenticationEndpoint and AuthenticationKey // need to be set for external authentication to be used. AuthenticationKey *string `json:",omitempty"` // When non nil, AuthenticationCertificate is a base64-encoded x509 certificate used to trust and // secure the communications to the server. It is in the same form as the AZD_AUTH_CERT environment variable. AuthenticationCertificate *string `json:",omitempty"` }
type ProgressMessage ¶
type ProgressMessage struct { Message string Severity MessageSeverity Time time.Time Kind MessageKind Code string AdditionalInfoLink string }
func (ProgressMessage) WithMessage ¶
func (m ProgressMessage) WithMessage(message string) ProgressMessage
WithMessage returns a new ProgressMessage with the given message and timestamp set to now.
type RequestContext ¶
type RequestContext struct { // The active session. Session Session // The app host project path. HostProjectPath string }
RequestContext provides the context for a request to the server. It identifies the active session and the azd project being operated on.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(rootContainer *ioc.NestedContainer) *Server
type Session ¶
type Session struct {
Id string
}
Session represents an active connection to the server. It is returned by InitializeAsync and holds an opaque connection id that the server can use to identify the client across multiple RPC calls (since our service is exposed over multiple endpoints a single client may have multiple connections to the server, and we want a way to correlate them so we can cache state across connections).
Source Files ¶
- aspire_service.go
- debug_service.go
- doc.go
- environment_service.go
- environment_service_create.go
- environment_service_deploy.go
- environment_service_load.go
- environment_service_refresh.go
- handler.go
- message_writer.go
- models.go
- observer.go
- server.go
- server_service.go
- server_session.go
- stream.go
- utils.go
- writer_multiplexer.go