commands

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: GPL-3.0 Imports: 58 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoardListWatchProxyToChan added in v1.0.0

func BoardListWatchProxyToChan(ctx context.Context) (rpc.ArduinoCoreService_BoardListWatchServer, <-chan *rpc.BoardListWatchResponse)

BoardListWatchProxyToChan return a stream, to be used in BoardListWatch method, that proxies all the responses to a channel.

func BurnBootloaderToServerStreams added in v1.0.0

func BurnBootloaderToServerStreams(ctx context.Context, outStrem, errStream io.Writer) rpc.ArduinoCoreService_BurnBootloaderServer

BurnBootloaderToServerStreams return a server stream that forwards the output and error streams to the provided io.Writers

func CompilerServerToStreams added in v1.0.0

func CompilerServerToStreams(ctx context.Context, stdOut, stderr io.Writer, progressCB rpc.TaskProgressCB) (server rpc.ArduinoCoreService_CompileServer, resultCB func() *rpc.BuilderResult)

CompilerServerToStreams creates a gRPC CompileServer that sends the responses to the provided streams. The returned callback function can be used to retrieve the builder result after the compilation is done.

func DebugServerToStreams added in v1.0.4

func DebugServerToStreams(
	ctx context.Context,
	req *rpc.GetDebugConfigRequest,
	in io.Reader, out io.Writer,
	sig chan os.Signal,
	resultCB func(*rpc.DebugResponse_Result),
) rpc.ArduinoCoreService_DebugServer

DebugServerToStreams creates a debug server that proxies the data to the given io streams. The GetDebugConfigRequest is used to configure the debbuger. sig is a channel that can be used to send os.Interrupt to the debug process. resultCB is a callback function that will receive the Debug result and closes the debug server.

func GitLibraryInstallStreamResponseToCallbackFunction added in v1.0.0

func GitLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_GitLibraryInstallServer

GitLibraryInstallStreamResponseToCallbackFunction returns a gRPC stream to be used in GitLibraryInstall that sends all responses to the callback function.

func InitStreamResponseToCallbackFunction added in v1.0.0

func InitStreamResponseToCallbackFunction(ctx context.Context, cb func(r *rpc.InitResponse) error) rpc.ArduinoCoreService_InitServer

InitStreamResponseToCallbackFunction returns a gRPC stream to be used in Init that sends all responses to the callback function.

func LibraryDownloadStreamResponseToCallbackFunction added in v1.0.0

func LibraryDownloadStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB) rpc.ArduinoCoreService_LibraryDownloadServer

LibraryDownloadStreamResponseToCallbackFunction returns a gRPC stream to be used in LibraryDownload that sends all responses to the callback function.

func LibraryInstallStreamResponseToCallbackFunction added in v1.0.0

func LibraryInstallStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_LibraryInstallServer

LibraryInstallStreamResponseToCallbackFunction returns a gRPC stream to be used in LibraryInstall that sends all responses to the callback function.

func LibraryUninstallStreamResponseToCallbackFunction added in v1.0.0

func LibraryUninstallStreamResponseToCallbackFunction(ctx context.Context, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_LibraryUninstallServer

LibraryUninstallStreamResponseToCallbackFunction returns a gRPC stream to be used in LibraryUninstall that sends all responses to the callback function.

func LibraryUpgradeAllStreamResponseToCallbackFunction added in v1.0.0

func LibraryUpgradeAllStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_LibraryUpgradeAllServer

LibraryUpgradeAllStreamResponseToCallbackFunction returns a gRPC stream to be used in LibraryUpgradeAll that sends all responses to the callback function.

func LibraryUpgradeStreamResponseToCallbackFunction added in v1.0.0

func LibraryUpgradeStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_LibraryUpgradeServer

LibraryUpgradeStreamResponseToCallbackFunction returns a gRPC stream to be used in LibraryUpgrade that sends all responses to the callback function.

func MatcherFromQueryString added in v1.0.0

func MatcherFromQueryString(query string) func(*librariesindex.Library) bool

MatcherFromQueryString returns a closure that takes a library as a parameter and returns true if the library matches the query.

func MonitorServerToReadWriteCloser added in v1.0.0

MonitorServerToReadWriteCloser creates a monitor server that proxies the data to a ReadWriteCloser. The server is returned along with the ReadWriteCloser that can be used to send and receive data to the server. The MonitorPortOpenRequest is used to configure the monitor.

func NewArduinoCoreServer added in v1.0.0

func NewArduinoCoreServer() rpc.ArduinoCoreServiceServer

NewArduinoCoreServer returns an implementation of the ArduinoCoreService gRPC service that uses the provided version string.

func PlatformDownloadStreamResponseToCallbackFunction added in v1.0.0

func PlatformDownloadStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB) rpc.ArduinoCoreService_PlatformDownloadServer

PlatformDownloadStreamResponseToCallbackFunction returns a gRPC stream to be used in PlatformDownload that sends all responses to the callback function.

func PlatformInstallStreamResponseToCallbackFunction added in v1.0.0

func PlatformInstallStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_PlatformInstallServer

UpdateIndexStreamResponseToCallbackFunction returns a gRPC stream to be used in PlatformInstall that sends all responses to the callback function.

func PlatformUninstallStreamResponseToCallbackFunction added in v1.0.0

func PlatformUninstallStreamResponseToCallbackFunction(ctx context.Context, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_PlatformUninstallServer

PlatformUninstallStreamResponseToCallbackFunction returns a gRPC stream to be used in PlatformUninstall that sends all responses to the callback function.

func PlatformUpgradeStreamResponseToCallbackFunction added in v1.0.0

func PlatformUpgradeStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB, taskCB rpc.TaskProgressCB) (rpc.ArduinoCoreService_PlatformUpgradeServer, func() *rpc.PlatformUpgradeResponse_Result)

PlatformUpgradeStreamResponseToCallbackFunction returns a gRPC stream to be used in PlatformUpgrade that sends all responses to the callback function.

func UpdateIndexStreamResponseToCallbackFunction added in v1.0.0

func UpdateIndexStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB) (rpc.ArduinoCoreService_UpdateIndexServer, func() *rpc.UpdateIndexResponse_Result)

UpdateIndexStreamResponseToCallbackFunction returns a gRPC stream to be used in UpdateIndex that sends all responses to the callback function.

func UpdateLibrariesIndexStreamResponseToCallbackFunction added in v1.0.0

func UpdateLibrariesIndexStreamResponseToCallbackFunction(ctx context.Context, downloadCB rpc.DownloadProgressCB) (rpc.ArduinoCoreService_UpdateLibrariesIndexServer, func() *rpc.UpdateLibrariesIndexResponse_Result)

UpdateLibrariesIndexStreamResponseToCallbackFunction returns a gRPC stream to be used in UpdateLibrariesIndex that sends all responses to the callback function.

func UploadToServerStreams added in v1.0.0

func UploadToServerStreams(ctx context.Context, outStream io.Writer, errStream io.Writer) (rpc.ArduinoCoreService_UploadServer, func() *rpc.UploadResult)

UploadToServerStreams return a server stream that forwards the output and error streams to the provided writers. It also returns a function that can be used to retrieve the result of the upload.

func ZipLibraryInstallStreamResponseToCallbackFunction added in v1.0.0

func ZipLibraryInstallStreamResponseToCallbackFunction(ctx context.Context, taskCB rpc.TaskProgressCB) rpc.ArduinoCoreService_ZipLibraryInstallServer

ZipLibraryInstallStreamResponseToCallbackFunction returns a gRPC stream to be used in ZipLibraryInstall that sends all responses to the callback function.

Types

type SynchronizedSender added in v1.0.0

type SynchronizedSender[T any] struct {
	// contains filtered or unexported fields
}

SynchronizedSender is a sender function with an extra protection for concurrent writes, if multiple threads call the Send method they will be blocked and serialized.

func NewSynchronizedSend added in v1.0.0

func NewSynchronizedSend[T any](send func(T) error) *SynchronizedSender[T]

NewSynchronizedSend takes a Send function and wraps it in a SynchronizedSender

func (*SynchronizedSender[T]) Send added in v1.0.0

func (s *SynchronizedSender[T]) Send(value T) error

Send the message using the underlyng stream.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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