11/*
22 * Copyright © 2022-2023 Durudex
33 *
4- * This source code is licensed under the MIT license found in the
5- * LICENSE file in the root directory of this source tree.
4+ * This source code is licensed under the MIT license found in the LICENSE
5+ * file in the root directory of this source tree.
66 */
77
88package polybase
@@ -16,20 +16,22 @@ import (
1616)
1717
1818const (
19- // The ClientHeaderKey constant stores the value of the client key for an HTTP header.
19+ // The ClientHeaderKey constant stores the value of the client key for
20+ // an HTTP header.
2021 ClientHeaderKey = "X-Polybase-Client"
2122
22- // The clientHeaderPrefix constant stores the value of the client prefix for an HTTP header.
23- // This value is added to the beginning of the client name specified in the configuration.
23+ // The clientHeaderPrefix constant stores the value of the client prefix
24+ // for an HTTP header. This value is added to the beginning of the client
25+ // name specified in the configuration.
2426 //
2527 // Example: "durudex/go-polybase:default-name"
2628 clientHeaderPrefix = "durudex/go-polybase:"
2729)
2830
2931// Client interface stores methods for interaction with Polybase Node.
3032type Client interface {
31- // MakeRequest method makes a request with the specified settings and decodes
32- // the JSON response.
33+ // MakeRequest method makes a request with the specified settings and
34+ // decodes the JSON response.
3335 MakeRequest (ctx context.Context , req * Request , resp any ) error
3436
3537 Config () * Config
@@ -67,20 +69,23 @@ type client struct {
6769 doer * http.Client
6870}
6971
70- // To start using the go-polybase client, you need to crete a new client instance. This can be
71- // done using the internal New() function, which returns a new instance with either a specified
72- // configuration or the default configuration.
72+ // To start using the go-polybase client, you need to crete a new client
73+ // instance. This can be done using the internal New() function, which
74+ // returns a new instance with either a specified configuration or the
75+ // default configuration.
7376//
74- // To create an instance with a specified configuration, you need to pass a pointer of Config
75- // value as an argument to the New(...) function. This can be useful if you want to use specific
76- // settings, for example, if you have your own configuration file.
77+ // To create an instance with a specified configuration, you need to pass
78+ // a pointer of Config value as an argument to the New(...) function. This
79+ // can be useful if you want to use specific settings, for example, if you
80+ // have your own configuration file.
7781//
7882// client := polybase.New(&polybase.Config{
7983// ...
8084// }
8185//
82- // If you want to use the default configuration, you can simply call the New() function without any
83- // arguments. The client will be created with the default configuration set in the go-polybase module.
86+ // If you want to use the default configuration, you can simply call the New()
87+ // function without any arguments. The client will be created with the default
88+ // configuration set in the go-polybase module.
8489//
8590// client := polybase.New()
8691func New (configs ... * Config ) Client {
@@ -97,7 +102,8 @@ func New(configs ...*Config) Client {
97102 return & client {cfg : cfg , doer : http .DefaultClient }
98103}
99104
100- // MakeRequest method makes a request with the specified settings and decodes the JSON response.
105+ // MakeRequest method makes a request with the specified settings and decodes
106+ // the JSON response.
101107func (c * client ) MakeRequest (ctx context.Context , req * Request , resp any ) error {
102108 // Creating a new HTTP request.
103109 rwc , err := c .newRequest (ctx , req )
0 commit comments