Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StatusClient ¶
type StatusClient struct {
ServerAddr string
Conn *grpc.ClientConn
Client pb.StatusServiceClient
}
StatusClient is a client for communicating with the status service.
func InitClient ¶
func InitClient(serverAddr string) (*StatusClient, error)
InitClient initializes a new StatusClient with a new gRPC channel for serverAddr.
Parameters:
- serverAddr: The address of the server to connect to.
Returns:
- *StatusClient: A pointer to the initialized StatusClient.
- error: An error if the client creation fails, otherwise nil.
func (*StatusClient) GetStatusInterval ¶
func (cli *StatusClient) GetStatusInterval(ctx context.Context, agentName string) (time.Duration, error)
GetStatusInterval retrieves the status interval from status service.
Parameters:
- ctx: The context for the request, used for cancellation and timeouts.
- agentName: The name of the agent for which the status interval is being requested.
Returns:
- time.Duration: The interval in seconds for the status updates.
- error: An error if the request fails, otherwise nil.
func (*StatusClient) SendStatusNotReady ¶
func (cli *StatusClient) SendStatusNotReady(ctx context.Context, agentName string) error
SendStatusNotReady sends a status request indicating that the agent is not ready.
Parameters:
- ctx: The context for the request, used for cancellation and timeouts.
- agentName: The name of the agent whose status is being updated.
Returns:
- error: An error if the status request fails, otherwise nil.
func (*StatusClient) SendStatusReady ¶
func (cli *StatusClient) SendStatusReady(ctx context.Context, agentName string) error
SendStatusReady sends a status request indicating that the agent is ready.
Parameters:
- ctx: The context for the request, used for cancellation and timeouts.
- agentName: The name of the agent whose status is being updated.
Returns:
- error: An error if the status request fails, otherwise nil.
Click to show internal directories.
Click to hide internal directories.