mirror of
https://github.com/lingble/talos.git
synced 2025-12-16 20:47:09 +00:00
feat: Add time api to apid
This extends apid to cover the time api. Signed-off-by: Brad Beam <brad.beam@talos-systems.com>
This commit is contained in:
committed by
Andrew Rynhard
parent
d3d011c8d2
commit
ee24e42319
@@ -327,20 +327,10 @@ func (c *Client) ServiceRestart(ctx context.Context, id string) (*machineapi.Ser
|
||||
|
||||
// Time returns the time
|
||||
func (c *Client) Time(ctx context.Context) (*timeapi.TimeReply, error) {
|
||||
r, err := c.TimeClient.Time(ctx, &empty.Empty{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r, nil
|
||||
return c.TimeClient.Time(ctx, &empty.Empty{})
|
||||
}
|
||||
|
||||
// TimeCheck returns the time compared to the specified ntp server
|
||||
func (c *Client) TimeCheck(ctx context.Context, server string) (*timeapi.TimeReply, error) {
|
||||
r, err := c.TimeClient.TimeCheck(ctx, &timeapi.TimeRequest{Server: server})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return r, nil
|
||||
return c.TimeClient.TimeCheck(ctx, &timeapi.TimeRequest{Server: server})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user