Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOffchainProvider ¶
type ClientOffchainProvider struct {
// contains filtered or unexported fields
}
ClientOffchainProvider is a JD provider that connects to a Job Distributor service via gRPC.
func NewClientOffchainProvider ¶
func NewClientOffchainProvider(config ClientOffchainProviderConfig) *ClientOffchainProvider
NewClientOffchainProvider creates a new ClientOffchainProvider with the given configuration.
func (*ClientOffchainProvider) Initialize ¶
func (p *ClientOffchainProvider) Initialize(ctx context.Context) (deployment.OffchainClient, error)
Initialize initializes the ClientOffchainProvider, setting up the JD client with the provided configuration. It returns the initialized deployment.OffchainClient or an error if initialization fails.
func (*ClientOffchainProvider) Name ¶
func (*ClientOffchainProvider) Name() string
Name returns the name of the ClientOffchainProvider.
func (*ClientOffchainProvider) OffchainClient ¶
func (p *ClientOffchainProvider) OffchainClient() deployment.OffchainClient
OffchainClient returns the JD client instance managed by this provider. You must call Initialize before using this method to ensure the client is properly set up.
type ClientOffchainProviderConfig ¶
type ClientOffchainProviderConfig struct {
// Required: The gRPC URL to connect to the Job Distributor service.
GRPC string
// Optional: The WebSocket RPC URL for the Job Distributor service.
WSRPC string
// Optional: Transport credentials for secure gRPC connections. Defaults to insecure.NewCredentials()
Creds credentials.TransportCredentials
// Optional: OAuth2 token source for authentication.
Auth oauth2.TokenSource
}
ClientOffchainProviderConfig holds the configuration to initialize the ClientOffchainProvider.