go-hep.org/x/hep@v0.38.1/xrootd/protocol.go (about)

     1  // Copyright ©2018 The go-hep Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package xrootd // import "go-hep.org/x/hep/xrootd"
     6  
     7  import (
     8  	"context"
     9  
    10  	"go-hep.org/x/hep/xrootd/xrdproto/protocol"
    11  )
    12  
    13  // Protocol obtains the protocol version number, type of the server and security information, such as:
    14  // the security version, the security options, the security level, and the list of alterations
    15  // needed to the specified predefined security level.
    16  func (sess *cliSession) Protocol(ctx context.Context) (protocol.Response, error) {
    17  	var resp protocol.Response
    18  	_, err := sess.Send(ctx, &resp, protocol.NewRequest(sess.protocolVersion, true))
    19  	// TODO: should we react somehow to redirection?
    20  	return resp, err
    21  }