api: document goroutine safeness
This commit is contained in:
parent
28be15864e
commit
7b5f88727a
|
@ -102,6 +102,8 @@ type Client interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new Client.
|
// New returns a new Client.
|
||||||
|
//
|
||||||
|
// It is safe to use the returned Client from multiple goroutines.
|
||||||
func New(cfg Config) (Client, error) {
|
func New(cfg Config) (Client, error) {
|
||||||
u, err := url.Parse(cfg.Address)
|
u, err := url.Parse(cfg.Address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -280,6 +282,8 @@ type QueryAPI interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewQueryAPI returns a new QueryAPI for the client.
|
// NewQueryAPI returns a new QueryAPI for the client.
|
||||||
|
//
|
||||||
|
// It is safe to use the returned QueryAPI from multiple goroutines.
|
||||||
func NewQueryAPI(c Client) QueryAPI {
|
func NewQueryAPI(c Client) QueryAPI {
|
||||||
return &httpQueryAPI{client: apiClient{c}}
|
return &httpQueryAPI{client: apiClient{c}}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue