Documentation ¶
Overview ¶
Package locate contains the types related to the locate request. See xrootd protocol specification (http://xrootd.org/doc/dev45/XRdv310.pdf, p. 51) for more details.
Example ¶
package main import ( "bytes" "context" "fmt" "log" "go-hep.org/x/hep/xrootd" "go-hep.org/x/hep/xrootd/xrdproto/locate" ) func main() { bkg := context.Background() cl, err := xrootd.NewClient(bkg, "ccxrootdgotest.in2p3.fr:9001", "gopher") if err != nil { log.Fatalf("could not create client: %v", err) } defer cl.Close() var ( resp locate.Response req = locate.Request{ Options: locate.PreferName | locate.Refresh | locate.AddPeers, Path: "/tmp/dir1/file1.txt", } ) id, err := cl.Send(bkg, &resp, &req) if err != nil { log.Fatalf("locate request error: %v", err) } fmt.Printf("sess: %s\n", id) fmt.Printf("locate: %q\n", bytes.TrimRight(resp.Data, "\x00")) }
Output: sess: ccxrootdgotest.in2p3.fr:9001 locate: "Sr[::127.0.0.1]:9001"
Index ¶
Examples ¶
Constants ¶
View Source
const ( AddPeers = 1 << 0 // AddPeers adds eligible peers to the location output Refresh = 1 << 7 // Refresh updates cached information on the file’s location PreferName = 1 << 8 // PreferName indicates a hostname response is preferred NoWait = 1 << 13 // NoWait provides informations as soon as possible )
locate options.
View Source
const RequestID uint16 = 3027
RequestID is the id of the request, it is sent as part of message. See xrootd protocol specification for details: http://xrootd.org/doc/dev45/XRdv310.pdf, 2.3 Client Request Format.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { Options uint16 // Options to apply when Path is opened Path string // Path of the file to locate // contains filtered or unexported fields }
Request holds the locate request parameters.
func (Request) MarshalXrd ¶
MarshalXrd implements xrdproto.Marshaler.
func (*Request) ShouldSign ¶
ShouldSign implements xrdproto.Request.ShouldSign.
Click to show internal directories.
Click to hide internal directories.