Skip to content

Commit 7b5f887

Browse files
authored
api: document goroutine safeness
1 parent 28be158 commit 7b5f887

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/prometheus/api.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ type Client interface {
102102
}
103103

104104
// New returns a new Client.
105+
//
106+
// It is safe to use the returned Client from multiple goroutines.
105107
func New(cfg Config) (Client, error) {
106108
u, err := url.Parse(cfg.Address)
107109
if err != nil {
@@ -280,6 +282,8 @@ type QueryAPI interface {
280282
}
281283

282284
// NewQueryAPI returns a new QueryAPI for the client.
285+
//
286+
// It is safe to use the returned QueryAPI from multiple goroutines.
283287
func NewQueryAPI(c Client) QueryAPI {
284288
return &httpQueryAPI{client: apiClient{c}}
285289
}

0 commit comments

Comments
 (0)