client

package
v2.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

Package client is an abstract API client for a Furan RPC service using API key authentication

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Address               string // Furan RPC server address (host:port)
	APIKey                string // RPC API key
	TLSInsecureSkipVerify bool   // Skip verifying TLS certificates (INSECURE)
}

Options contains options for the RPC client

type RemoteBuilder

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

RemoteBuilder is a Furan RPC client

func New

func New(opts Options) (*RemoteBuilder, error)

New returns a Furan RPC client connected to Options.Address using Options.APIKey for authentication. TLS is enabled by default unless specifically disabled. You must call Close() on the client to close the connection and free resources when finished

func (*RemoteBuilder) CancelBuild

func (rb *RemoteBuilder) CancelBuild(ctx context.Context, id uuid.UUID) error

CancelBuild requests cancellation for a currently running build

func (*RemoteBuilder) Close

func (rb *RemoteBuilder) Close()

Close closes any active connections to the RPC server

func (*RemoteBuilder) GetBuildEvents

func (rb *RemoteBuilder) GetBuildEvents(ctx context.Context, id uuid.UUID) (*furanrpc.BuildEventsResponse, error)

func (*RemoteBuilder) GetBuildStatus

func (rb *RemoteBuilder) GetBuildStatus(ctx context.Context, id uuid.UUID) (*furanrpc.BuildStatusResponse, error)

GetBuildStatus gets the current build status for the build id

func (*RemoteBuilder) ListBuilds

func (*RemoteBuilder) MonitorBuild

MonitorBuild opens a streaming RPC connection to monitor build events for a currently-running build Call the Recv() method on the returned monitor client to receive build messages Cancel the context when finished to close the connection

func (*RemoteBuilder) StartBuild

func (rb *RemoteBuilder) StartBuild(ctx context.Context, req *furanrpc.BuildRequest) (uuid.UUID, error)

StartBuild starts a build and returns the id or error

Jump to

Keyboard shortcuts

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