Skip to content

Commit

Permalink
Lint cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
fbx committed May 11, 2021
1 parent bbea13e commit db6f8a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions pkg/eosclient/eosgrpc/eos_http/eoshttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,18 @@ func (opt *Options) Init() error {
return nil
}

// EosHTTPClient performs HTTP-based tasks (e.g. upload, download)
// Client performs HTTP-based tasks (e.g. upload, download)
// against a EOS management node (MGM)
// using the EOS XrdHTTP interface.
// In this module we wrap eos-related behaviour, e.g. headers or r/w retries
type EosHTTPClient struct {
type Client struct {
opt Options

cl *http.Client
}

// New creates a new client with the given options.
func New(opt *Options) *EosHTTPClient {
func New(opt *Options) *Client {
log := logger.New().With().Int("pid", os.Getpid()).Logger()
log.Debug().Str("func", "New").Str("Creating new eoshttp client. opt: ", "'"+fmt.Sprintf("%#v", opt)+"' ").Msg("")

Expand All @@ -152,7 +152,7 @@ func New(opt *Options) *EosHTTPClient {
return nil
}

c := new(EosHTTPClient)
c := new(Client)
c.opt = *opt

// Let's be successful if the ping was ok. This is an initialization phase
Expand Down Expand Up @@ -195,7 +195,7 @@ func rspdesc(rsp *http.Response) string {

// If the error is not nil, take that
// If there is an error coming from EOS, erturn a descriptive error
func (c *EosHTTPClient) getRespError(rsp *http.Response, err error) error {
func (c *Client) getRespError(rsp *http.Response, err error) error {
if err != nil {
return err
}
Expand All @@ -218,7 +218,7 @@ func (c *EosHTTPClient) getRespError(rsp *http.Response, err error) error {
}

// From the basepath and the file path... build an url
func (c *EosHTTPClient) buildFullURL(urlpath, uid, gid string) (string, error) {
func (c *Client) buildFullURL(urlpath, uid, gid string) (string, error) {
s := c.opt.BaseURL
if len(urlpath) > 0 && urlpath[0] != '/' {
s += "/"
Expand Down Expand Up @@ -259,7 +259,7 @@ func (c *EosHTTPClient) buildFullURL(urlpath, uid, gid string) (string, error) {
}

// GETFile does an entire GET to download a full file. Returns a stream to read the content from
func (c *EosHTTPClient) GETFile(ctx context.Context, remoteuser, uid, gid, urlpath string, stream io.WriteCloser) (io.ReadCloser, error) {
func (c *Client) GETFile(ctx context.Context, remoteuser, uid, gid, urlpath string, stream io.WriteCloser) (io.ReadCloser, error) {

log := appctx.GetLogger(ctx)
log.Info().Str("func", "GETFile").Str("remoteuser", remoteuser).Str("uid,gid", uid+","+gid).Str("path", urlpath).Msg("")
Expand Down Expand Up @@ -354,7 +354,7 @@ func (c *EosHTTPClient) GETFile(ctx context.Context, remoteuser, uid, gid, urlpa
}

// PUTFile does an entire PUT to upload a full file, taking the data from a stream
func (c *EosHTTPClient) PUTFile(ctx context.Context, remoteuser, uid, gid, urlpath string, stream io.ReadCloser) error {
func (c *Client) PUTFile(ctx context.Context, remoteuser, uid, gid, urlpath string, stream io.ReadCloser) error {

log := appctx.GetLogger(ctx)
log.Info().Str("func", "PUTFile").Str("remoteuser", remoteuser).Str("uid,gid", uid+","+gid).Str("path", urlpath).Msg("")
Expand Down Expand Up @@ -442,7 +442,7 @@ func (c *EosHTTPClient) PUTFile(ctx context.Context, remoteuser, uid, gid, urlpa
}

// Head performs a HEAD req. Useful to check the server
func (c *EosHTTPClient) Head(ctx context.Context, remoteuser, uid, gid, urlpath string) error {
func (c *Client) Head(ctx context.Context, remoteuser, uid, gid, urlpath string) error {

log := appctx.GetLogger(ctx)
log.Info().Str("func", "Head").Str("remoteuser", remoteuser).Str("uid,gid", uid+","+gid).Str("path", urlpath).Msg("")
Expand Down
2 changes: 1 addition & 1 deletion pkg/eosclient/eosgrpc/eosgrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ type Client struct {
}

// GetHTTPCl creates an http client for immediate usage, using the already instantiated resources
func (c *Client) GetHTTPCl() *ehttp.EosHTTPClient {
func (c *Client) GetHTTPCl() *ehttp.Client {
return ehttp.New(&c.opt.httpopts)
}

Expand Down

0 comments on commit db6f8a1

Please sign in to comment.