Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Irods implements minio.Gateway.
- type Irods struct {
- host string
- port int
- zone string
- colPath string
- user string
- pass string
- }
- // NewGatewayLayer initializes GoRODS client and returns iRODS-backed minio.ObjectLayer interface
- func (g *Irods) NewGatewayLayer(creds auth.Credentials) (minio.ObjectLayer, error) {
- rodsCon, conErr := gorods.NewConnection(&gorods.ConnectionOptions{
- Type: gorods.UserDefined,
- Host: g.host,
- Port: g.port,
- Zone: g.zone,
- Username: creds.AccessKey,
- Password: creds.SecretKey,
- })
- if conErr != nil {
- return nil, conErr
- }
- col, err := rodsCon.Collection(gorods.CollectionOptions{
- Path: g.colPath,
- })
- if err != nil {
- return nil, err
- }
- return &irodsObjects{
- col: col,
- }, nil
- }
Add Comment
Please, Sign In to add comment