hep: go-hep.org/x/hep/xrootd/xrdproto/locate Index | Examples | Files

package locate

import "go-hep.org/x/hep/xrootd/xrdproto/locate"

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.

Code:

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

Package Files

locate.go

Constants

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.

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.

type Request Uses

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 Uses

func (o Request) MarshalXrd(w *xrdenc.WBuffer) error

MarshalXrd implements xrdproto.Marshaler.

func (*Request) ReqID Uses

func (req *Request) ReqID() uint16

ReqID implements xrdproto.Request.ReqID.

func (*Request) ShouldSign Uses

func (*Request) ShouldSign() bool

ShouldSign implements xrdproto.Request.ShouldSign.

func (*Request) UnmarshalXrd Uses

func (o *Request) UnmarshalXrd(r *xrdenc.RBuffer) error

UnmarshalXrd implements xrdproto.Unmarshaler.

type Response Uses

type Response struct {
    Data []byte
}

Response is the response issued by the server to a locate request.

func (Response) MarshalXrd Uses

func (o Response) MarshalXrd(w *xrdenc.WBuffer) error

MarshalXrd implements xrdproto.Marshaler.

func (*Response) RespID Uses

func (*Response) RespID() uint16

RespID implements xrdproto.Response.RespID.

func (*Response) UnmarshalXrd Uses

func (o *Response) UnmarshalXrd(r *xrdenc.RBuffer) error

UnmarshalXrd implements xrdproto.Unmarshaler.

Package locate imports 1 packages (graph). Updated 2019-01-06. Refresh now. Tools for package owners.