go-hep.org/x/hep@v0.38.1/groot/riofs/plugin/xrootd/xrootd.go (about)

     1  // Copyright ©2019 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 is a plugin for riofs.Open to support opening ROOT files over xrootd.
     6  package xrootd
     7  
     8  import (
     9  	"go-hep.org/x/hep/groot/riofs"
    10  	"go-hep.org/x/hep/xrootd/xrdio"
    11  )
    12  
    13  func init() {
    14  	riofs.Register("root", openFile)
    15  	riofs.Register("xroot", openFile)
    16  }
    17  
    18  func openFile(path string) (riofs.Reader, error) {
    19  	return xrdio.Open(path)
    20  }
    21  
    22  var (
    23  	_ riofs.Reader = (*xrdio.File)(nil)
    24  	_ riofs.Writer = (*xrdio.File)(nil)
    25  )