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:
Brad Beam
2019-10-25 19:08:55 +00:00
committed by Andrew Rynhard
parent d3d011c8d2
commit ee24e42319
12 changed files with 310 additions and 87 deletions

View File

@@ -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})
}