arcast/pkg/client/status.go

22 lines
400 B
Go
Raw Permalink Normal View History

2023-12-13 20:07:22 +01:00
package client
import (
"context"
"fmt"
"forge.cadoles.com/arcad/arcast/pkg/server"
"github.com/pkg/errors"
)
func (c *Client) Status(ctx context.Context, addr string) (*Status, error) {
endpoint := fmt.Sprintf("http://%s/api/v1/status", addr)
res := &server.StatusResponse{}
if err := c.apiGet(ctx, endpoint, res); err != nil {
return nil, errors.WithStack(err)
}
return res, nil
}