client

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFlowClientInvalidAddress    = errors.New("FlowClient: invalid address")
	ErrFlowClientInvalidDialOpts   = errors.New("FlowClient: invalid dial options")
	ErrFlowClientInvalidSecureOpts = errors.New("FlowClient: invalid secure options")
	ErrFlowClientInvalidServerCA   = errors.New("FlowClient: invalid server CA")
	ErrFlowClientInvalidClientCA   = errors.New("FlowClient: invalid client CA")
	ErrFlowClientInvalidClientKey  = errors.New("FlowClient: invalid client key")
	ErrFlowClientInvalidClientCert = errors.New("FlowClient: invalid client cert")
)

Errors

View Source
var (
	ErrNICoCoreClientInvalidAddress    = errors.New("NICoCoreClient: invalid address")
	ErrNICoCoreClientInvalidDialOpts   = errors.New("NICoCoreClient: invalid dial options")
	ErrNICoCoreClientInvalidSecureOpts = errors.New("NICoCoreClient: invalid secure options")
	ErrNICoCoreClientInvalidServerCA   = errors.New("NICoCoreClient: invalid server CA")
	ErrNICoCoreClientInvalidClientCA   = errors.New("NICoCoreClient: invalid client CA")
	ErrNICoCoreClientInvalidClientKey  = errors.New("NICoCoreClient: invalid client key")
	ErrNICoCoreClientInvalidClientCert = errors.New("NICoCoreClient: invalid client cert")
	ErrClientNotConnected              = errors.New("gRPC client is not connected to the server")
)

Errors

Functions

func SliceToChunks

func SliceToChunks[T any](slice []T, chunkSize int) (chunks [][]T)

Types

type FlowAtomicClient

type FlowAtomicClient struct {
	Config *FlowClientConfig
	// contains filtered or unexported fields
}

FlowAtomicClient is an atomic wrapper around the FlowClient

func NewFlowAtomicClient

func NewFlowAtomicClient(config *FlowClientConfig) *FlowAtomicClient

NewFlowAtomicClient creates a new FlowAtomicClient

func (*FlowAtomicClient) CheckAndReloadCerts

func (rac *FlowAtomicClient) CheckAndReloadCerts(initialClientCertMD5, initialServerCAMD5 []byte)

CheckAndReloadCerts continuously monitors the TLS certificates for changes. If a change is detected, it reinitializes the FlowClient with the new certificates to ensure secure communication.

func (*FlowAtomicClient) CheckCertificates

func (rac *FlowAtomicClient) CheckCertificates(lastClientCertMD5, lastServerCAMD5 []byte) (bool, []byte, []byte, error)

CheckCertificates checks if the client and server CA certificates have changed

func (*FlowAtomicClient) GetClient

func (rac *FlowAtomicClient) GetClient() *FlowClient

GetClient returns the current version of Flow client from the atomic value. Returns nil if the client has not been initialized yet.

func (*FlowAtomicClient) GetFlowClient

func (rac *FlowAtomicClient) GetFlowClient() (flowv1.FlowClient, error)

GetFlowClient returns the underlying Flow gRPC client. Returns ErrClientNotConnected if the client has not been initialized or is not currently connected. Prefer this over GetClient() + manual nil-check + .Flow() at call sites.

func (*FlowAtomicClient) GetInitialCertMD5

func (rac *FlowAtomicClient) GetInitialCertMD5() (clientCertMD5, serverCAMD5 []byte, err error)

GetInitialCertMD5 retrieves the MD5 hash of the initial set of certificate that the client is Using

func (*FlowAtomicClient) SwapClient

func (rac *FlowAtomicClient) SwapClient(newClient *FlowClient) *FlowClient

SwapClient atomically replaces the current FlowClient with a new one, returning the old client for the caller to manage.

func (*FlowAtomicClient) Version

func (rac *FlowAtomicClient) Version() int64

Version returns the current version of the FlowClient

type FlowClient

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

FlowClient is the data structure for the client

func NewFlowClient

func NewFlowClient(config *FlowClientConfig) (client *FlowClient, err error)

NewFlowClient creates a new FlowClient

func NewMockFlowClient

func NewMockFlowClient() *FlowClient

NewMockFlowClient creates a new mock FlowClient that can be used with FlowAtomicClient.SwapClient

func (*FlowClient) Close

func (cc *FlowClient) Close() error

Close gracefully shuts down the client's gRPC connection.

func (*FlowClient) Flow

func (client *FlowClient) Flow() flowv1.FlowClient

Flow client getter

type FlowClientConfig

type FlowClientConfig struct {
	// The address of the server <host>:<port>
	Address string
	// Secure flag
	Secure FlowClientSecureOptions
	// Skip Server Auth
	SkipServerAuth bool
	// The TLS certificate for the server
	ServerCAPath string
	// The TLS certificate for the client
	ClientCertPath string
	// The TLS key for the client
	ClientKeyPath string
	// client metrics interface
	ClientMetrics Metrics
}

FlowClientConfig is the data structure for the client configuration

type FlowClientSecureOptions

type FlowClientSecureOptions int

SecureOptions is the enum for the secure options

const (
	// FlowInsecureGrpc is the insecure dial option
	FlowInsecureGrpc FlowClientSecureOptions = iota
	// FlowServerTLS is the secure dial option for server tls
	FlowServerTLS
	// FlowMutualTLS for mutual tls
	FlowMutualTLS
)

type Metrics

type Metrics interface {
	// RecordRpcResponse call-back method that includes rpc method, response code, and duration
	RecordRpcResponse(method, code string, duration time.Duration)
}

Metrics interface that defines call-back functions for RPC metrics

type MockFlowClient

type MockFlowClient struct {
	flowv1.FlowClient
}

MockFlowClient is a mock implementation of Flow gRPC protobuf Client

func (*MockFlowClient) AddComponent

Component mutation mock methods

func (*MockFlowClient) AssociateRuleWithRack

func (c *MockFlowClient) AssociateRuleWithRack(ctx context.Context, in *flowv1.AssociateRuleWithRackRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

Rack-rule association mock methods

func (*MockFlowClient) AttachRacksToNVLDomain

func (c *MockFlowClient) AttachRacksToNVLDomain(ctx context.Context, in *flowv1.AttachRacksToNVLDomainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) BringUpRack

func (*MockFlowClient) CancelTask

func (*MockFlowClient) CreateExpectedRack

Rack mock methods

func (*MockFlowClient) CreateNVLDomain

NVL Domain mock methods

func (*MockFlowClient) CreateOperationRule

Operation rule mock methods

func (*MockFlowClient) DeleteComponent

func (*MockFlowClient) DeleteOperationRule

func (c *MockFlowClient) DeleteOperationRule(ctx context.Context, in *flowv1.DeleteOperationRuleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) DetachRacksFromNVLDomain

func (c *MockFlowClient) DetachRacksFromNVLDomain(ctx context.Context, in *flowv1.DetachRacksFromNVLDomainRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) DisassociateRuleFromRack

func (c *MockFlowClient) DisassociateRuleFromRack(ctx context.Context, in *flowv1.DisassociateRuleFromRackRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) GetComponentInfoByID

Component mock methods

func (*MockFlowClient) GetComponentInfoBySerial

func (*MockFlowClient) GetComponents

func (*MockFlowClient) GetListOfNVLDomains

func (*MockFlowClient) GetListOfRacks

func (*MockFlowClient) GetOperationRule

func (*MockFlowClient) GetRackInfoByID

func (*MockFlowClient) GetRackInfoBySerial

func (*MockFlowClient) GetTasksByIDs

func (*MockFlowClient) IngestRack

func (*MockFlowClient) ListOperationRules

func (*MockFlowClient) ListTasks

func (*MockFlowClient) PatchComponent

func (*MockFlowClient) PatchRack

func (*MockFlowClient) PowerOffRack

func (*MockFlowClient) PowerOnRack

func (*MockFlowClient) PowerResetRack

func (*MockFlowClient) SetRuleAsDefault

func (c *MockFlowClient) SetRuleAsDefault(ctx context.Context, in *flowv1.SetRuleAsDefaultRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) UpdateOperationRule

func (c *MockFlowClient) UpdateOperationRule(ctx context.Context, in *flowv1.UpdateOperationRuleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockFlowClient) UpgradeFirmware

Task mock methods

func (*MockFlowClient) ValidateComponents

func (*MockFlowClient) Version

Version mock methods

type MockNICoClient

type MockNICoClient struct {
	wflows.ForgeClient
}

MockNICoClient is a mock implementation of NICo gRPC protobuf Client

func (*MockNICoClient) AddExpectedMachine

func (c *MockNICoClient) AddExpectedMachine(ctx context.Context, in *wflows.ExpectedMachine, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Machine mock methods

func (*MockNICoClient) AddExpectedPowerShelf

func (c *MockNICoClient) AddExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelf, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Power Shelf mock methods

func (*MockNICoClient) AddExpectedRack

func (c *MockNICoClient) AddExpectedRack(ctx context.Context, in *wflows.ExpectedRack, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Rack mock methods

func (*MockNICoClient) AddExpectedSwitch

func (c *MockNICoClient) AddExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitch, opts ...grpc.CallOption) (*emptypb.Empty, error)

Expected Switch mock methods

func (*MockNICoClient) AddMachineValidationTest

Machine Validation Test mock methods

func (*MockNICoClient) AddUpdateMachineValidationExternalConfig

func (c *MockNICoClient) AddUpdateMachineValidationExternalConfig(ctx context.Context, in *wflows.AddUpdateMachineValidationExternalConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) AllocateInstance

Instance mock methods

func (*MockNICoClient) CreateDpuExtensionService

DPU Extension Service mock methods

func (*MockNICoClient) CreateIBPartition

InfiniBand Partition mock methods

func (*MockNICoClient) CreateInstanceType

Instance Type mock methods

func (*MockNICoClient) CreateNVLinkLogicalPartition

NVLink Logical Partition Mocks

func (*MockNICoClient) CreateNetworkSegment

func (*MockNICoClient) CreateOsImage

func (c *MockNICoClient) CreateOsImage(ctx context.Context, in *wflows.OsImageAttributes, opts ...grpc.CallOption) (*wflows.OsImage, error)

OS Image mock methods

func (*MockNICoClient) CreateTenant

Tenant mock methods

func (*MockNICoClient) CreateTenantKeyset

Tenant Keyset mock methods

func (*MockNICoClient) CreateVpc

func (c *MockNICoClient) CreateVpc(ctx context.Context, in *wflows.VpcCreationRequest, opts ...grpc.CallOption) (*wflows.Vpc, error)

VPC mock methods

func (*MockNICoClient) CreateVpcPeering

VPC Peering mock methods

func (*MockNICoClient) CreateVpcPrefix

VPC Prefix mock methods

func (*MockNICoClient) DeleteAllExpectedRacks

func (c *MockNICoClient) DeleteAllExpectedRacks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) DeleteExpectedMachine

func (c *MockNICoClient) DeleteExpectedMachine(ctx context.Context, in *wflows.ExpectedMachineRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) DeleteExpectedPowerShelf

func (c *MockNICoClient) DeleteExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelfRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) DeleteExpectedRack

func (c *MockNICoClient) DeleteExpectedRack(ctx context.Context, in *wflows.ExpectedRackRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) DeleteExpectedSwitch

func (c *MockNICoClient) DeleteExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitchRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) DeleteIBPartition

func (*MockNICoClient) DeleteInstanceType

func (*MockNICoClient) DeleteOsImage

func (*MockNICoClient) DeleteTenantKeyset

func (*MockNICoClient) DeleteVpc

func (*MockNICoClient) DeleteVpcPeering

func (*MockNICoClient) DeleteVpcPrefix

func (*MockNICoClient) FindDpuExtensionServiceIds

func (*MockNICoClient) FindDpuExtensionServicesByIds

func (*MockNICoClient) FindIBPartitionIds

func (*MockNICoClient) FindIBPartitionsByIds

func (c *MockNICoClient) FindIBPartitionsByIds(ctx context.Context, in *wflows.IBPartitionsByIdsRequest, opts ...grpc.CallOption) (*wflows.IBPartitionList, error)

func (*MockNICoClient) FindInstanceIds

func (*MockNICoClient) FindInstanceTypeIds

func (*MockNICoClient) FindInstancesByIds

func (c *MockNICoClient) FindInstancesByIds(ctx context.Context, in *wflows.InstancesByIdsRequest, opts ...grpc.CallOption) (*wflows.InstanceList, error)

func (*MockNICoClient) FindMachineIds

func (*MockNICoClient) FindMachinesByIds

func (c *MockNICoClient) FindMachinesByIds(ctx context.Context, in *wflows.MachinesByIdsRequest, opts ...grpc.CallOption) (*wflows.MachineList, error)

func (*MockNICoClient) FindNetworkSegmentIds

func (*MockNICoClient) FindNetworkSegmentsByIds

func (*MockNICoClient) FindSkusByIds

func (c *MockNICoClient) FindSkusByIds(ctx context.Context, in *wflows.SkusByIdsRequest, opts ...grpc.CallOption) (*wflows.SkuList, error)

SKU mock methods

func (*MockNICoClient) FindTenant

func (*MockNICoClient) FindTenantKeysetIds

func (*MockNICoClient) FindTenantKeysetsByIds

func (c *MockNICoClient) FindTenantKeysetsByIds(ctx context.Context, in *wflows.TenantKeysetsByIdsRequest, opts ...grpc.CallOption) (*wflows.TenantKeySetList, error)

func (*MockNICoClient) FindTenantOrganizationIds

func (c *MockNICoClient) FindTenantOrganizationIds(ctx context.Context, in *wflows.TenantSearchFilter, opts ...grpc.CallOption) (*wflows.TenantOrganizationIdList, error)

func (*MockNICoClient) FindTenantsByOrganizationIds

func (c *MockNICoClient) FindTenantsByOrganizationIds(ctx context.Context, in *wflows.TenantByOrganizationIdsRequest, opts ...grpc.CallOption) (*wflows.TenantList, error)

func (*MockNICoClient) FindVpcIds

func (*MockNICoClient) FindVpcPeeringIds

func (*MockNICoClient) FindVpcPeeringsByIds

func (c *MockNICoClient) FindVpcPeeringsByIds(ctx context.Context, in *wflows.VpcPeeringsByIdsRequest, opts ...grpc.CallOption) (*wflows.VpcPeeringList, error)

func (*MockNICoClient) FindVpcsByIds

func (c *MockNICoClient) FindVpcsByIds(ctx context.Context, in *wflows.VpcsByIdsRequest, opts ...grpc.CallOption) (*wflows.VpcList, error)

func (*MockNICoClient) GetAllExpectedMachines

func (c *MockNICoClient) GetAllExpectedMachines(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedMachineList, error)

func (*MockNICoClient) GetAllExpectedMachinesLinked

func (c *MockNICoClient) GetAllExpectedMachinesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedMachineList, error)

func (*MockNICoClient) GetAllExpectedPowerShelves

func (c *MockNICoClient) GetAllExpectedPowerShelves(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedPowerShelfList, error)

func (*MockNICoClient) GetAllExpectedPowerShelvesLinked

func (c *MockNICoClient) GetAllExpectedPowerShelvesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedPowerShelfList, error)

func (*MockNICoClient) GetAllExpectedRacks

func (c *MockNICoClient) GetAllExpectedRacks(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedRackList, error)

func (*MockNICoClient) GetAllExpectedSwitches

func (c *MockNICoClient) GetAllExpectedSwitches(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.ExpectedSwitchList, error)

func (*MockNICoClient) GetAllExpectedSwitchesLinked

func (c *MockNICoClient) GetAllExpectedSwitchesLinked(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.LinkedExpectedSwitchList, error)

func (*MockNICoClient) GetAllSkuIds

func (c *MockNICoClient) GetAllSkuIds(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*wflows.SkuIdList, error)

func (*MockNICoClient) GetExpectedMachine

func (*MockNICoClient) GetExpectedRack

func (c *MockNICoClient) GetExpectedRack(ctx context.Context, in *wflows.ExpectedRackRequest, opts ...grpc.CallOption) (*wflows.ExpectedRack, error)

func (*MockNICoClient) GetMachineValidationResults

func (*MockNICoClient) GetVpcPrefixes

func (*MockNICoClient) InvokeInstancePower

func (*MockNICoClient) ListOsImage

func (*MockNICoClient) NVLinkLogicalPartitionsForTenant

func (c *MockNICoClient) NVLinkLogicalPartitionsForTenant(ctx context.Context, in *wflows.TenantSearchQuery, opts ...grpc.CallOption) (*wflows.NVLinkLogicalPartitionList, error)

func (*MockNICoClient) PersistValidationResult

func (c *MockNICoClient) PersistValidationResult(ctx context.Context, in *wflows.MachineValidationResultPostRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) ReleaseInstance

func (*MockNICoClient) RemoveMachineValidationExternalConfig

func (c *MockNICoClient) RemoveMachineValidationExternalConfig(ctx context.Context, in *wflows.RemoveMachineValidationExternalConfigRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) ReplaceAllExpectedRacks

func (c *MockNICoClient) ReplaceAllExpectedRacks(ctx context.Context, in *wflows.ExpectedRackList, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) SearchVpcPrefixes

func (*MockNICoClient) SetMaintenance

func (c *MockNICoClient) SetMaintenance(ctx context.Context, in *wflows.MaintenanceRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

Machine mock methods

func (*MockNICoClient) UpdateDpuExtensionService

func (*MockNICoClient) UpdateExpectedMachine

func (c *MockNICoClient) UpdateExpectedMachine(ctx context.Context, in *wflows.ExpectedMachine, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) UpdateExpectedPowerShelf

func (c *MockNICoClient) UpdateExpectedPowerShelf(ctx context.Context, in *wflows.ExpectedPowerShelf, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) UpdateExpectedRack

func (c *MockNICoClient) UpdateExpectedRack(ctx context.Context, in *wflows.ExpectedRack, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) UpdateExpectedSwitch

func (c *MockNICoClient) UpdateExpectedSwitch(ctx context.Context, in *wflows.ExpectedSwitch, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) UpdateIBPartition

func (*MockNICoClient) UpdateInstanceConfig

func (c *MockNICoClient) UpdateInstanceConfig(ctx context.Context, in *wflows.InstanceConfigUpdateRequest, opts ...grpc.CallOption) (*wflows.Instance, error)

func (*MockNICoClient) UpdateInstanceType

func (*MockNICoClient) UpdateMachineMetadata

func (c *MockNICoClient) UpdateMachineMetadata(ctx context.Context, in *wflows.MachineMetadataUpdateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)

func (*MockNICoClient) UpdateMachineValidationRun

Network Security Group mock methods

func (*MockNICoClient) UpdateOsImage

func (c *MockNICoClient) UpdateOsImage(ctx context.Context, in *wflows.OsImageAttributes, opts ...grpc.CallOption) (*wflows.OsImage, error)

func (*MockNICoClient) UpdateTenant

func (*MockNICoClient) UpdateTenantKeyset

func (*MockNICoClient) UpdateVpc

func (*MockNICoClient) UpdateVpcPrefix

func (c *MockNICoClient) UpdateVpcPrefix(ctx context.Context, in *wflows.VpcPrefixUpdateRequest, opts ...grpc.CallOption) (*wflows.VpcPrefix, error)

func (*MockNICoClient) Version

Version mock methods

type NICoCoreAtomicClient

type NICoCoreAtomicClient struct {
	Config *NICoCoreClientConfig
	// contains filtered or unexported fields
}

NICoCoreAtomicClient is an atomic wrapper around the NICoCoreClient

func NewNICoCoreAtomicClient

func NewNICoCoreAtomicClient(config *NICoCoreClientConfig) *NICoCoreAtomicClient

NewNICoCoreAtomicClient creates a new NICoCoreAtomicClient

func (*NICoCoreAtomicClient) CheckAndReloadCerts

func (cac *NICoCoreAtomicClient) CheckAndReloadCerts(initialClientCertMD5, initialServerCAMD5 []byte)

CheckAndReloadCerts continuously monitors the TLS certificates for changes. If a change is detected, it reinitializes the NICoCoreClient with the new certificates to ensure secure communication.

func (*NICoCoreAtomicClient) CheckCertificates

func (cac *NICoCoreAtomicClient) CheckCertificates(lastClientCertMD5, lastServerCAMD5 []byte) (bool, []byte, []byte, error)

CheckCertificates checks if the client and server CA certificates have changed

func (*NICoCoreAtomicClient) GetClient

func (cac *NICoCoreAtomicClient) GetClient() *NICoCoreClient

GetClient returns the current version of NICo client from the atomic value. Returns nil if the client has not been initialized yet.

func (*NICoCoreAtomicClient) GetInitialCertMD5

func (cac *NICoCoreAtomicClient) GetInitialCertMD5() (clientCertMD5, serverCAMD5 []byte, err error)

GetInitialCertMD5 retrieves the MD5 hash of the initial set of certificate that the client is Using

func (*NICoCoreAtomicClient) SwapClient

func (cac *NICoCoreAtomicClient) SwapClient(newClient *NICoCoreClient) *NICoCoreClient

SwapClient atomically replaces the current NICoCoreClient with a new one, returning the old client for the caller to manage.

func (*NICoCoreAtomicClient) Version

func (cac *NICoCoreAtomicClient) Version() int64

Version returns the current version of the NICoCoreClient

type NICoCoreClient

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

NICoCoreClient is the data structure for the client

func NewMockNICoClient

func NewMockNICoClient() *NICoCoreClient

NewMockNICoClient creates a new mock NICoCoreClient

func NewNICoCoreClient

func NewNICoCoreClient(config *NICoCoreClientConfig) (client *NICoCoreClient, err error)

NewNICoCoreClient creates a new NICoCoreClient

func (*NICoCoreClient) Close

func (cc *NICoCoreClient) Close() error

Close gracefully shuts down the client's gRPC connection.

func (*NICoCoreClient) NICo

func (client *NICoCoreClient) NICo() wflows.ForgeClient

NICo client getter

type NICoCoreClientConfig

type NICoCoreClientConfig struct {
	// The address of the server <host>:<port>
	Address string
	// Secure flag
	Secure SecureOptions
	// Skip Server Auth
	SkipServerAuth bool
	// The TLS certificate for the server
	ServerCAPath string
	// The TLS certificate for the client
	ClientCertPath string
	// The TLS key for the client
	ClientKeyPath string
	// client metrics interface
	ClientMetrics Metrics
}

NICoCoreClientConfig is the data structure for the client configuration

type SecureOptions

type SecureOptions int

SecureOptions is the enum for the secure options

const (
	// InsecuregRPC is the insecure dial option
	InsecuregRPC SecureOptions = iota
	// ServerTLS is the secure dial option for server tls
	ServerTLS
	// MutualTLS for mutual tls
	MutualTLS
)

Jump to

Keyboard shortcuts

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