diff --git a/changelog/unreleased/eosclientgrpc.md b/changelog/unreleased/eosclientgrpc.md new file mode 100644 index 0000000000..401b39c887 --- /dev/null +++ b/changelog/unreleased/eosclientgrpc.md @@ -0,0 +1,3 @@ +Enhancement: add support for the protobuf interface to eos metadata + +https://github.com/cs3org/reva/pull/1154 diff --git a/changelog/unreleased/fab-merge.md b/changelog/unreleased/fab-merge.md new file mode 100644 index 0000000000..670b3c3220 --- /dev/null +++ b/changelog/unreleased/fab-merge.md @@ -0,0 +1,3 @@ +Enhancement: Merge-rebase from master 10/11/2020 + +https://github.com/cs3org/reva/pull/1154 diff --git a/go.mod b/go.mod index 551fe328a0..c6a9a6385c 100644 --- a/go.mod +++ b/go.mod @@ -43,6 +43,7 @@ require ( github.com/tus/tusd v1.1.1-0.20200416115059-9deabf9d80c2 go.opencensus.io v0.22.5 golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 + golang.org/x/net v0.0.0-20200625001655-4c5254603344 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d google.golang.org/grpc v1.33.2 ) diff --git a/go.sum b/go.sum index 322b1c944b..1630d01d73 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,4 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.40.0/go.mod h1:Tk58MuI9rbLMKlAjeO/bDnteAx7tX2gJIXw4T5Jwlro= @@ -77,6 +78,8 @@ github.com/cheggaaa/pb v1.0.29/go.mod h1:W40334L7FMC5JKWldsTWbdGjLo0RxUKK73K+TuP github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-oidc v2.2.1+incompatible h1:mh48q/BqXqgjVHpy2ZY7WnWAbenxRjsz9N1i1YxjHAk= @@ -105,10 +108,14 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczC github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/elazarl/goproxy v0.0.0-20181003060214-f58a169a71a5/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/frairon/go-outline-parser v0.0.0-20190121070907-667a12a58dc7 h1:e51TJxKNXMK4fMoWgE66qTxxAd61n/96crp9kLxtMSU= +github.com/frairon/go-outline-parser v0.0.0-20190121070907-667a12a58dc7/go.mod h1:MRv+DV4k24QxFqPyMYZYXCot7FM8fofLvxsHgvZHNi8= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -163,6 +170,7 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= @@ -175,6 +183,7 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -290,6 +299,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836 h1:oc3CL18CoGhyOQJ7HDa9gJAde33bwI8Vi28zLdIzJVc= +github.com/nsf/gocode v0.0.0-20190302080247-5bee97b48836/go.mod h1:6Q8/OMaaKAgTX7/jt2bOXVDrm1eJhoNd+iwzghR7jvs= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/oleiade/reflections v1.0.0 h1:0ir4pc6v8/PJ0yw5AEtMddfXpWBXg9cnG7SgSoJuCgY= github.com/oleiade/reflections v1.0.0/go.mod h1:RbATFBbKYkVdqmSFtx13Bb/tVhR0lgOBXunWTZKeL4w= @@ -320,7 +331,6 @@ github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= github.com/pkg/xattr v0.4.2 h1:fbVxr9lvkToTGgPljVszvFsOdcbSv5BmGABneyxRgZM= github.com/pkg/xattr v0.4.2/go.mod h1:sBD3RAqlr8Q+RC3FutZcikpT8nyDrIEEBw2J744gVWs= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= @@ -360,27 +370,19 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72 h1:qLC7fQah7D6K1B0ujays3HV9gkFtllcxhzImRR7ArPQ= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.3.2 h1:GDarE4TJQI52kYSbSAmLiId1Elfj+xgSDqrUZxFhxlU= github.com/spf13/afero v1.3.2/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -390,14 +392,11 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/studio-b12/gowebdav v0.0.0-20200303150724-9380631c29a1 h1:TPyHV/OgChqNcnYqCoCvIFjR9TU60gFXXBKnhOBzVEI= github.com/studio-b12/gowebdav v0.0.0-20200303150724-9380631c29a1/go.mod h1:gCcfDlA1Y7GqOaeEKw5l9dOGx1VLdc/HuQSlQAaZ30s= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tus/tusd v1.1.0/go.mod h1:3DWPOdeCnjBwKtv98y5dSws3itPqfce5TVa0s59LRiA= @@ -449,6 +448,7 @@ golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMk golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -465,9 +465,9 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -506,6 +506,7 @@ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208 h1:qwRHBd0NqMbJxfbotnDhm2ByMI1Shq4Y6oRJo21SGJA= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -543,7 +544,6 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200918174421-af09f7315aff h1:1CPUrky56AcgSpxz/KfgzQWzfG09u5YOL8MvPYBlrL8= golang.org/x/sys v0.0.0-20200918174421-af09f7315aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 h1:a/mKvvZr9Jcc8oKfcmgzyp7OwF73JPWsQLvH1z2Kxck= golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -558,6 +558,7 @@ golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -589,11 +590,9 @@ golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200522201501-cb1345f3a375/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200721223218-6123e77877b2 h1:kxDWg8KNMtpGjI/XVKGgOtSljTnVg/PrjhS8+0pxjLE= golang.org/x/tools v0.0.0-20200721223218-6123e77877b2/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= @@ -608,10 +607,10 @@ google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -635,28 +634,44 @@ google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215 h1:0Uz5jLJQioKgVozXa1gzGbzYxbb/rhQEVvSWxzw5oUs= google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/Acconut/lockfile.v1 v1.1.0/go.mod h1:6UCz3wJ8tSFUsPR6uP/j8uegEtDuEEqFxlpi0JI4Umw= gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/h2non/gock.v1 v1.0.14/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.57.0 h1:9unxIsFcTt4I55uWluz+UmL95q4kdJ0buvQ1ZIqVQww= gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.5.1 h1:7odma5RETjNHWJnR32wx8t+Io4djHE1PqxCFx3iiZ2w= @@ -669,7 +684,6 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c h1:grhR+C34yXImVGp7EzNk+DTIk+323eIUWOmEevy6bDo= gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/pkg/eosclient/eosbinary/eosbinary.go b/pkg/eosclient/eosbinary/eosbinary.go new file mode 100644 index 0000000000..7787fe8eee --- /dev/null +++ b/pkg/eosclient/eosbinary/eosbinary.go @@ -0,0 +1,944 @@ +// Copyright 2018-2020 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +package eosbinary + +import ( + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "os" + "os/exec" + "path" + "strconv" + "strings" + "syscall" + + "github.com/cs3org/reva/pkg/appctx" + "github.com/cs3org/reva/pkg/eosclient" + "github.com/cs3org/reva/pkg/errtypes" + "github.com/cs3org/reva/pkg/storage/utils/acl" + "github.com/gofrs/uuid" + "github.com/pkg/errors" + "go.opencensus.io/trace" +) + +type eosVersion string + +const ( + versionPrefix = ".sys.v#." + + versionAquamarine = eosVersion("aquamarine") + versionCitrine = eosVersion("citrine") +) + +const ( + // SystemAttr is the system extended attribute. + SystemAttr eosclient.AttrType = iota + // UserAttr is the user extended attribute. + UserAttr +) + +func serializeAttribute(a *eosclient.Attribute) string { + return fmt.Sprintf("%d.%s=%s", a.Type, a.Key, a.Val) +} + +func isValidAttribute(a *eosclient.Attribute) bool { + // validate that an attribute is correct. + if (a.Type != SystemAttr && a.Type != UserAttr) || a.Key == "" { + return false + } + return true +} + +// Options to configure the Client. +type Options struct { + + // ForceSingleUserMode forces all connections to use only one user. + // This is the case when access to EOS is done from FUSE under apache or www-data. + ForceSingleUserMode bool + + // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. + UseKeytab bool + + // Whether to maintain the same inode across various versions of a file. + // Requires extra metadata operations if set to true + VersionInvariant bool + + // SingleUsername is the username to use when connecting to EOS. + // Defaults to apache + SingleUsername string + + // Location of the eos binary. + // Default is /usr/bin/eos. + EosBinary string + + // Location of the xrdcopy binary. + // Default is /usr/bin/xrdcopy. + XrdcopyBinary string + + // URL of the EOS MGM. + // Default is root://eos-example.org + URL string + + // Location on the local fs where to store reads. + // Defaults to os.TempDir() + CacheDirectory string + + // Keytab is the location of the EOS keytab file. + Keytab string + + // SecProtocol is the comma separated list of security protocols used by xrootd. + // For example: "sss, unix" + SecProtocol string +} + +func (opt *Options) init() { + if opt.ForceSingleUserMode && opt.SingleUsername != "" { + opt.SingleUsername = "apache" + } + + if opt.EosBinary == "" { + opt.EosBinary = "/usr/bin/eos" + } + + if opt.XrdcopyBinary == "" { + opt.XrdcopyBinary = "/usr/bin/xrdcopy" + } + + if opt.URL == "" { + opt.URL = "root://eos-example.org" + } + + if opt.CacheDirectory == "" { + opt.CacheDirectory = os.TempDir() + } +} + +// Client performs actions against a EOS management node (MGM). +// It requires the eos-client and xrootd-client packages installed to work. +type Client struct { + opt *Options +} + +// New creates a new client with the given options. +func New(opt *Options) *Client { + opt.init() + c := new(Client) + c.opt = opt + return c +} + +// exec executes the command and returns the stdout, stderr and return code +func (c *Client) execute(ctx context.Context, cmd *exec.Cmd) (string, string, error) { + log := appctx.GetLogger(ctx) + + outBuf := &bytes.Buffer{} + errBuf := &bytes.Buffer{} + cmd.Stdout = outBuf + cmd.Stderr = errBuf + cmd.Env = []string{ + "EOS_MGM_URL=" + c.opt.URL, + } + + if c.opt.UseKeytab { + cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol) + cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab) + } + + err := cmd.Run() + + var exitStatus int + if exiterr, ok := err.(*exec.ExitError); ok { + // The program has exited with an exit code != 0 + // This works on both Unix and Windows. Although package + // syscall is generally platform dependent, WaitStatus is + // defined for both Unix and Windows and in both cases has + // an ExitStatus() method with the same signature. + if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { + + exitStatus = status.ExitStatus() + switch exitStatus { + case 0: + err = nil + case int(syscall.ENOENT): + err = errtypes.NotFound(errBuf.String()) + } + } + } + + args := fmt.Sprintf("%s", cmd.Args) + env := fmt.Sprintf("%s", cmd.Env) + log.Info().Str("args", args).Str("env", env).Int("exit", exitStatus).Msg("eos cmd") + + if err != nil && exitStatus != int(syscall.ENOENT) { // don't wrap the errtypes.NotFoundError + err = errors.Wrap(err, "eosclient: error while executing command") + } + + return outBuf.String(), errBuf.String(), err +} + +// exec executes only EOS commands the command and returns the stdout, stderr and return code. +// execute() executes arbitrary commands. +func (c *Client) executeEOS(ctx context.Context, cmd *exec.Cmd) (string, string, error) { + log := appctx.GetLogger(ctx) + + outBuf := &bytes.Buffer{} + errBuf := &bytes.Buffer{} + cmd.Stdout = outBuf + cmd.Stderr = errBuf + cmd.Env = []string{ + "EOS_MGM_URL=" + c.opt.URL, + } + if c.opt.UseKeytab { + cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol) + cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab) + } + + trace := trace.FromContext(ctx).SpanContext().TraceID.String() + cmd.Args = append(cmd.Args, "--comment", trace) + + err := cmd.Run() + + var exitStatus int + if exiterr, ok := err.(*exec.ExitError); ok { + // The program has exited with an exit code != 0 + // This works on both Unix and Windows. Although package + // syscall is generally platform dependent, WaitStatus is + // defined for both Unix and Windows and in both cases has + // an ExitStatus() method with the same signature. + if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { + exitStatus = status.ExitStatus() + switch exitStatus { + case 0: + err = nil + case int(syscall.ENOENT): + err = errtypes.NotFound(errBuf.String()) + case int(syscall.EPERM), int(syscall.E2BIG), int(syscall.EINVAL): + // eos reports back error code 1 (EPERM) when ? + // eos reports back error code 7 (E2BIG) when the user is not allowed to read the directory + // eos reports back error code 22 (EINVAL) when the user is not allowed to enter the instance + err = errtypes.PermissionDenied(errBuf.String()) + } + } + } + + args := fmt.Sprintf("%s", cmd.Args) + env := fmt.Sprintf("%s", cmd.Env) + log.Info().Str("args", args).Str("env", env).Int("exit", exitStatus).Str("err", errBuf.String()).Msg("eos cmd") + + if err != nil && exitStatus != int(syscall.ENOENT) { // don't wrap the errtypes.NotFoundError + err = errors.Wrap(err, "eosclient: error while executing command") + } + + return outBuf.String(), errBuf.String(), err +} + +func (c *Client) getVersion(ctx context.Context, rootUID, rootGID string) (eosVersion, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "version") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return "", err + } + return c.parseVersion(ctx, stdout), nil +} + +func (c *Client) parseVersion(ctx context.Context, raw string) eosVersion { + var serverVersion string + rawLines := strings.Split(raw, "\n") + for _, rl := range rawLines { + if rl == "" { + continue + } + if strings.HasPrefix(rl, "EOS_SERVER_VERSION") { + serverVersion = strings.Split(strings.Split(rl, " ")[0], "=")[1] + break + } + } + + if strings.HasPrefix(serverVersion, "4.") { + return versionCitrine + } + return versionAquamarine +} + +// AddACL adds an new acl to EOS with the given aclType. +func (c *Client) AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { + version, err := c.getVersion(ctx, rootUID, rootGID) + if err != nil { + return err + } + + var cmd *exec.Cmd + if version == versionCitrine { + sysACL := a.CitrineSerialize() + cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "acl", "--sys", "--recursive", sysACL, path) + } else { + acls, err := c.getACLForPath(ctx, uid, gid, path) + if err != nil { + return err + } + + err = acls.SetEntry(a.Type, a.Qualifier, a.Permissions) + if err != nil { + return err + } + sysACL := acls.Serialize() + cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "attr", "-r", "set", fmt.Sprintf("sys.acl=%s", sysACL), path) + } + + _, _, err = c.executeEOS(ctx, cmd) + return err + +} + +// RemoveACL removes the acl from EOS. +func (c *Client) RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { + version, err := c.getVersion(ctx, rootUID, rootGID) + if err != nil { + return err + } + + var cmd *exec.Cmd + if version == versionCitrine { + sysACL := a.CitrineSerialize() + cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "acl", "--sys", "--recursive", sysACL, path) + } else { + acls, err := c.getACLForPath(ctx, uid, gid, path) + if err != nil { + return err + } + + acls.DeleteEntry(a.Type, a.Qualifier) + sysACL := acls.Serialize() + cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "attr", "-r", "set", fmt.Sprintf("sys.acl=%s", sysACL), path) + } + + _, _, err = c.executeEOS(ctx, cmd) + return err + +} + +// UpdateACL updates the EOS acl. +func (c *Client) UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { + return c.AddACL(ctx, uid, gid, rootUID, rootGID, path, a) +} + +// GetACL for a file +func (c *Client) GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error) { + acls, err := c.ListACLs(ctx, uid, gid, path) + if err != nil { + return nil, err + } + for _, a := range acls { + if a.Type == aclType && a.Qualifier == target { + return a, nil + } + } + return nil, errtypes.NotFound(fmt.Sprintf("%s:%s", aclType, target)) + +} + +// ListACLs returns the list of ACLs present under the given path. +// EOS returns uids/gid for Citrine version and usernames for older versions. +// For Citire we need to convert back the uid back to username. +func (c *Client) ListACLs(ctx context.Context, uid, gid, path string) ([]*acl.Entry, error) { + + parsedACLs, err := c.getACLForPath(ctx, uid, gid, path) + if err != nil { + return nil, err + } + + // EOS Citrine ACLs are stored with uid. The UID will be resolved to the + // user opaque ID at the eosfs level. + return parsedACLs.Entries, nil +} + +func (c *Client) getACLForPath(ctx context.Context, uid, gid, path string) (*acl.ACLs, error) { + finfo, err := c.GetFileInfoByPath(ctx, uid, gid, path) + if err != nil { + return nil, err + } + + return acl.Parse(finfo.SysACL, acl.ShortTextForm) +} + +// GetFileInfoByInode returns the FileInfo by the given inode +func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*eosclient.FileInfo, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", fmt.Sprintf("inode:%d", inode), "-m") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, err + } + info, err := c.parseFileInfo(stdout) + if err != nil { + return nil, err + } + + if c.opt.VersionInvariant && isVersionFolder(info.File) { + info, err = c.getFileInfoFromVersion(ctx, uid, gid, info.File) + if err != nil { + return nil, err + } + info.Inode = inode + } + + return info, nil +} + +// GetFileInfoByFXID returns the FileInfo by the given file id in hexadecimal +func (c *Client) GetFileInfoByFXID(ctx context.Context, uid, gid string, fxid string) (*eosclient.FileInfo, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", fmt.Sprintf("fxid:%s", fxid), "-m") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, err + } + return c.parseFileInfo(stdout) +} + +// SetAttr sets an extended attributes on a path. +func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *eosclient.Attribute, recursive bool, path string) error { + if !isValidAttribute(attr) { + return errors.New("eos: attr is invalid: " + serializeAttribute(attr)) + } + var cmd *exec.Cmd + if recursive { + cmd = exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "-r", "set", serializeAttribute(attr), path) + } else { + cmd = exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "set", serializeAttribute(attr), path) + } + + _, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return err + } + return nil +} + +// UnsetAttr unsets an extended attribute on a path. +func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *eosclient.Attribute, path string) error { + if !isValidAttribute(attr) { + return errors.New("eos: attr is invalid: " + serializeAttribute(attr)) + } + cmd := exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "-r", "rm", fmt.Sprintf("%d.%s", attr.Type, attr.Key), path) + _, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return err + } + return nil +} + +// GetFileInfoByPath returns the FilInfo at the given path +func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*eosclient.FileInfo, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", path, "-m") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, err + } + info, err := c.parseFileInfo(stdout) + if err != nil { + return nil, err + } + + if c.opt.VersionInvariant && !isVersionFolder(path) && !info.IsDir { + inode, err := c.getVersionFolderInode(ctx, uid, gid, path) + if err != nil { + return nil, err + } + info.Inode = inode + } + + return info, nil +} + +// GetQuota gets the quota of a user on the quota node defined by path +func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*eosclient.QuotaInfo, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "quota", "ls", "-u", username, "-m") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, err + } + return c.parseQuota(path, stdout) +} + +// Touch creates a 0-size,0-replica file in the EOS namespace. +func (c *Client) Touch(ctx context.Context, uid, gid, path string) error { + cmd := exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "file", "touch", path) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// Chown given path +func (c *Client) Chown(ctx context.Context, uid, gid, chownUID, chownGID, path string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "chown", chownUID+":"+chownGID, path) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// Chmod given path +func (c *Client) Chmod(ctx context.Context, uid, gid, mode, path string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "chmod", mode, path) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// CreateDir creates a directory at the given path +func (c *Client) CreateDir(ctx context.Context, uid, gid, path string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "mkdir", "-p", path) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// Remove removes the resource at the given path +func (c *Client) Remove(ctx context.Context, uid, gid, path string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "rm", "-r", path) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// Rename renames the resource referenced by oldPath to newPath +func (c *Client) Rename(ctx context.Context, uid, gid, oldPath, newPath string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "rename", oldPath, newPath) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// List the contents of the directory given by path +func (c *Client) List(ctx context.Context, uid, gid, path string) ([]*eosclient.FileInfo, error) { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "find", "--fileinfo", "--maxdepth", "1", path) + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) + } + return c.parseFind(path, stdout) +} + +// Read reads a file from the mgm +func (c *Client) Read(ctx context.Context, uid, gid, path string) (io.ReadCloser, error) { + rand := "eosread-" + uuid.Must(uuid.NewV4()).String() + localTarget := fmt.Sprintf("%s/%s", c.opt.CacheDirectory, rand) + defer os.RemoveAll(localTarget) + + xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) + cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", xrdPath, localTarget, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s", uid, gid)) + _, _, err := c.execute(ctx, cmd) + if err != nil { + return nil, err + } + return os.Open(localTarget) +} + +// Write writes a stream to the mgm +func (c *Client) Write(ctx context.Context, uid, gid, path string, stream io.ReadCloser) error { + fd, err := ioutil.TempFile(c.opt.CacheDirectory, "eoswrite-") + if err != nil { + return err + } + defer fd.Close() + defer os.RemoveAll(fd.Name()) + + // copy stream to local temp file + _, err = io.Copy(fd, stream) + if err != nil { + return err + } + + return c.WriteFile(ctx, uid, gid, path, fd.Name()) +} + +// WriteFile writes an existing file to the mgm +func (c *Client) WriteFile(ctx context.Context, uid, gid, path, source string) error { + xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) + cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", source, xrdPath, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s", uid, gid)) + _, _, err := c.execute(ctx, cmd) + return err +} + +// ListDeletedEntries returns a list of the deleted entries. +func (c *Client) ListDeletedEntries(ctx context.Context, uid, gid string) ([]*eosclient.DeletedEntry, error) { + // TODO(labkode): add protection if slave is configured and alive to count how many files are in the trashbin before + // triggering the recycle ls call that could break the instance because of unavailable memory. + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "ls", "-m") + stdout, _, err := c.executeEOS(ctx, cmd) + if err != nil { + return nil, err + } + return parseRecycleList(stdout) +} + +// RestoreDeletedEntry restores a deleted entry. +func (c *Client) RestoreDeletedEntry(ctx context.Context, uid, gid, key string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "restore", key) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// PurgeDeletedEntries purges all entries from the recycle bin. +func (c *Client) PurgeDeletedEntries(ctx context.Context, uid, gid string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "purge") + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// ListVersions list all the versions for a given file. +func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*eosclient.FileInfo, error) { + versionFolder := getVersionFolder(p) + finfos, err := c.List(ctx, uid, gid, versionFolder) + if err != nil { + // we send back an empty list + return []*eosclient.FileInfo{}, nil + } + return finfos, nil +} + +// RollbackToVersion rollbacks a file to a previous version. +func (c *Client) RollbackToVersion(ctx context.Context, uid, gid, path, version string) error { + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "versions", path, version) + _, _, err := c.executeEOS(ctx, cmd) + return err +} + +// ReadVersion reads the version for the given file. +func (c *Client) ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error) { + versionFile := path.Join(getVersionFolder(p), version) + return c.Read(ctx, uid, gid, versionFile) +} + +func (c *Client) getVersionFolderInode(ctx context.Context, uid, gid, p string) (uint64, error) { + versionFolder := getVersionFolder(p) + md, err := c.GetFileInfoByPath(ctx, uid, gid, versionFolder) + if err != nil { + if err = c.CreateDir(ctx, uid, gid, versionFolder); err != nil { + return 0, err + } + md, err = c.GetFileInfoByPath(ctx, uid, gid, versionFolder) + if err != nil { + return 0, err + } + } + return md.Inode, nil +} + +func (c *Client) getFileInfoFromVersion(ctx context.Context, uid, gid, p string) (*eosclient.FileInfo, error) { + file := getFileFromVersionFolder(p) + md, err := c.GetFileInfoByPath(ctx, uid, gid, file) + if err != nil { + return nil, err + } + return md, nil +} + +func isVersionFolder(p string) bool { + return strings.HasPrefix(path.Base(p), versionPrefix) +} + +func getVersionFolder(p string) string { + return path.Join(path.Dir(p), versionPrefix+path.Base(p)) +} + +func getFileFromVersionFolder(p string) string { + return path.Join(path.Dir(p), strings.TrimPrefix(path.Base(p), versionPrefix)) +} + +func parseRecycleList(raw string) ([]*eosclient.DeletedEntry, error) { + entries := []*eosclient.DeletedEntry{} + rawLines := strings.FieldsFunc(raw, func(c rune) bool { + return c == '\n' + }) + for _, rl := range rawLines { + if rl == "" { + continue + } + entry, err := parseRecycleEntry(rl) + if err != nil { + return nil, err + } + entries = append(entries, entry) + } + return entries, nil +} + +// parse entries like these: +// recycle=ls recycle-bin=/eos/backup/proc/recycle/ uid=gonzalhu gid=it size=0 deletion-time=1510823151 type=recursive-dir keylength.restore-path=45 restore-path=/eos/scratch/user/g/gonzalhu/.sys.v#.app.ico/ restore-key=0000000000a35100 +// recycle=ls recycle-bin=/eos/backup/proc/recycle/ uid=gonzalhu gid=it size=381038 deletion-time=1510823151 type=file keylength.restore-path=36 restore-path=/eos/scratch/user/g/gonzalhu/app.ico restore-key=000000002544fdb3 +func parseRecycleEntry(raw string) (*eosclient.DeletedEntry, error) { + partsBySpace := strings.FieldsFunc(raw, func(c rune) bool { + return c == ' ' + }) + restoreKeyPair, partsBySpace := partsBySpace[len(partsBySpace)-1], partsBySpace[:len(partsBySpace)-1] + restorePathPair := strings.Join(partsBySpace[8:], " ") + + partsBySpace = partsBySpace[:8] + partsBySpace = append(partsBySpace, restorePathPair) + partsBySpace = append(partsBySpace, restoreKeyPair) + + kv := getMap(partsBySpace) + size, err := strconv.ParseUint(kv["size"], 10, 64) + if err != nil { + return nil, err + } + isDir := false + if kv["type"] == "recursive-dir" { + isDir = true + } + deletionMTime, err := strconv.ParseUint(strings.Split(kv["deletion-time"], ".")[0], 10, 64) + if err != nil { + return nil, err + } + entry := &eosclient.DeletedEntry{ + RestorePath: kv["restore-path"], + RestoreKey: kv["restore-key"], + Size: size, + DeletionMTime: deletionMTime, + IsDir: isDir, + } + return entry, nil +} + +func getMap(partsBySpace []string) map[string]string { + kv := map[string]string{} + for _, pair := range partsBySpace { + parts := strings.Split(pair, "=") + if len(parts) > 1 { + kv[parts[0]] = parts[1] + } + + } + return kv +} + +func (c *Client) parseFind(dirPath, raw string) ([]*eosclient.FileInfo, error) { + finfos := []*eosclient.FileInfo{} + rawLines := strings.FieldsFunc(raw, func(c rune) bool { + return c == '\n' + }) + for _, rl := range rawLines { + if rl == "" { + continue + } + fi, err := c.parseFileInfo(rl) + if err != nil { + return nil, err + } + // dirs in eos end with a slash, like /eos/user/g/gonzalhu/ + // we skip the current directory as eos find will return the directory we + // ask to find + if fi.File == path.Clean(dirPath) { + continue + } + finfos = append(finfos, fi) + } + return finfos, nil +} + +func (c Client) parseQuotaLine(line string) map[string]string { + partsBySpace := strings.FieldsFunc(line, func(c rune) bool { + return c == ' ' + }) + m := getMap(partsBySpace) + return m +} +func (c *Client) parseQuota(path, raw string) (*eosclient.QuotaInfo, error) { + rawLines := strings.FieldsFunc(raw, func(c rune) bool { + return c == '\n' + }) + for _, rl := range rawLines { + if rl == "" { + continue + } + + m := c.parseQuotaLine(rl) + // map[maxbytes:2000000000000 maxlogicalbytes:1000000000000 percentageusedbytes:0.49 quota:node uid:gonzalhu space:/eos/scratch/user/ usedbytes:9829986500 usedlogicalbytes:4914993250 statusfiles:ok usedfiles:334 maxfiles:1000000 statusbytes:ok] + + space := m["space"] + if strings.HasPrefix(path, space) { + maxBytesString := m["maxlogicalbytes"] + usedBytesString := m["usedlogicalbytes"] + maxBytes, _ := strconv.ParseInt(maxBytesString, 10, 64) + usedBytes, _ := strconv.ParseInt(usedBytesString, 10, 64) + + maxInodesString := m["maxfiles"] + usedInodesString := m["usedfiles"] + maxInodes, _ := strconv.ParseInt(maxInodesString, 10, 64) + usedInodes, _ := strconv.ParseInt(usedInodesString, 10, 64) + + qi := &eosclient.QuotaInfo{ + AvailableBytes: int(maxBytes), + UsedBytes: int(usedBytes), + AvailableInodes: int(maxInodes), + UsedInodes: int(usedInodes), + } + return qi, nil + } + } + return &eosclient.QuotaInfo{}, nil +} + +// TODO(labkode): better API to access extended attributes. +func (c *Client) parseFileInfo(raw string) (*eosclient.FileInfo, error) { + + line := raw[15:] + index := strings.Index(line, " file=/") + lengthString := line[0:index] + length, err := strconv.ParseUint(lengthString, 10, 64) + if err != nil { + return nil, err + } + + line = line[index+6:] // skip ' file=' + name := line[0:length] + + kv := make(map[string]string) + // strip trailing slash + kv["file"] = strings.TrimSuffix(name, "/") + + line = line[length+1:] + partsBySpace := strings.FieldsFunc(line, func(c rune) bool { // we have [size=45 container=3 ...} + return c == ' ' + }) + var previousXAttr = "" + for _, p := range partsBySpace { + partsByEqual := strings.Split(p, "=") // we have kv pairs like [size 14] + if len(partsByEqual) == 2 { + // handle xattrn and xattrv special cases + switch { + case partsByEqual[0] == "xattrn": + previousXAttr = partsByEqual[1] + case partsByEqual[0] == "xattrv": + kv[previousXAttr] = partsByEqual[1] + previousXAttr = "" + default: + kv[partsByEqual[0]] = partsByEqual[1] + + } + } + } + + fi, err := c.mapToFileInfo(kv) + if err != nil { + return nil, err + } + return fi, nil +} + +// mapToFileInfo converts the dictionary to an usable structure. +// The kv has format: +// map[sys.forced.space:default files:0 mode:42555 ino:5 sys.forced.blocksize:4k sys.forced.layout:replica uid:0 fid:5 sys.forced.blockchecksum:crc32c sys.recycle:/eos/backup/proc/recycle/ fxid:00000005 pid:1 etag:5:0.000 keylength.file:4 file:/eos treesize:1931593933849913 container:3 gid:0 mtime:1498571294.108614409 ctime:1460121992.294326762 pxid:00000001 sys.forced.checksum:adler sys.forced.nstripes:2] +func (c *Client) mapToFileInfo(kv map[string]string) (*eosclient.FileInfo, error) { + inode, err := strconv.ParseUint(kv["ino"], 10, 64) + if err != nil { + return nil, err + } + fid, err := strconv.ParseUint(kv["fid"], 10, 64) + if err != nil { + return nil, err + } + uid, err := strconv.ParseUint(kv["uid"], 10, 64) + if err != nil { + return nil, err + } + gid, err := strconv.ParseUint(kv["gid"], 10, 64) + if err != nil { + return nil, err + } + + var treeSize uint64 + // treeSize is only for containers, so we check + if val, ok := kv["treesize"]; ok { + treeSize, err = strconv.ParseUint(val, 10, 64) + if err != nil { + return nil, err + } + } + var fileCounter uint64 + // fileCounter is only for containers + if val, ok := kv["files"]; ok { + fileCounter, err = strconv.ParseUint(val, 10, 64) + if err != nil { + return nil, err + } + } + var dirCounter uint64 + // dirCounter is only for containers + if val, ok := kv["container"]; ok { + dirCounter, err = strconv.ParseUint(val, 10, 64) + if err != nil { + return nil, err + } + } + + // treeCount is the number of entries under the tree + treeCount := fileCounter + dirCounter + + var size uint64 + if val, ok := kv["size"]; ok { + size, err = strconv.ParseUint(val, 10, 64) + if err != nil { + return nil, err + } + } + + // look for the stime first as mtime is not updated for parent dirs; if that isn't set, we use mtime + var mtimesec, mtimenanos uint64 + var mtimeSet bool + if val, ok := kv["stime"]; ok && val != "" { + stimeSplit := strings.Split(val, ".") + if mtimesec, err = strconv.ParseUint(stimeSplit[0], 10, 64); err == nil { + mtimeSet = true + } + if mtimenanos, err = strconv.ParseUint(stimeSplit[1], 10, 32); err != nil { + mtimeSet = false + } + } + if !mtimeSet { + mtimeSplit := strings.Split(kv["mtime"], ".") + if mtimesec, err = strconv.ParseUint(mtimeSplit[0], 10, 64); err != nil { + return nil, err + } + if mtimenanos, err = strconv.ParseUint(mtimeSplit[1], 10, 32); err != nil { + return nil, err + } + } + + isDir := false + if _, ok := kv["files"]; ok { + isDir = true + } + + fi := &eosclient.FileInfo{ + File: kv["file"], + Inode: inode, + FID: fid, + UID: uid, + GID: gid, + ETag: kv["etag"], + Size: size, + TreeSize: treeSize, + MTimeSec: mtimesec, + MTimeNanos: uint32(mtimenanos), + IsDir: isDir, + Instance: c.opt.URL, + SysACL: kv["sys.acl"], + TreeCount: treeCount, + Attrs: kv, + } + + return fi, nil +} diff --git a/pkg/eosclient/eosclient.go b/pkg/eosclient/eosclient.go index ba4daf1108..370b70ce73 100644 --- a/pkg/eosclient/eosclient.go +++ b/pkg/eosclient/eosclient.go @@ -19,950 +19,53 @@ package eosclient import ( - "bytes" "context" - "fmt" "io" - "io/ioutil" - "os" - "os/exec" - "path" - "strconv" - "strings" - "syscall" - "github.com/cs3org/reva/pkg/appctx" - "github.com/cs3org/reva/pkg/errtypes" "github.com/cs3org/reva/pkg/storage/utils/acl" - "github.com/gofrs/uuid" - "github.com/pkg/errors" - "go.opencensus.io/trace" ) -const ( - versionPrefix = ".sys.v#." - - versionAquamarine = eosVersion("aquamarine") - versionCitrine = eosVersion("citrine") -) +// EOSClient is the interface which enables access to EOS instances through various interfaces. +type EOSClient interface { + AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error + RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error + UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error + GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error) + ListACLs(ctx context.Context, uid, gid, path string) ([]*acl.Entry, error) + GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*FileInfo, error) + GetFileInfoByFXID(ctx context.Context, uid, gid string, fxid string) (*FileInfo, error) + GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*FileInfo, error) + SetAttr(ctx context.Context, uid, gid string, attr *Attribute, recursive bool, path string) error + UnsetAttr(ctx context.Context, uid, gid string, attr *Attribute, path string) error + GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*QuotaInfo, error) + Touch(ctx context.Context, uid, gid, path string) error + Chown(ctx context.Context, uid, gid, chownUID, chownGID, path string) error + Chmod(ctx context.Context, uid, gid, mode, path string) error + CreateDir(ctx context.Context, uid, gid, path string) error + Remove(ctx context.Context, uid, gid, path string) error + Rename(ctx context.Context, uid, gid, oldPath, newPath string) error + List(ctx context.Context, uid, gid, path string) ([]*FileInfo, error) + Read(ctx context.Context, uid, gid, path string) (io.ReadCloser, error) + Write(ctx context.Context, uid, gid, path string, stream io.ReadCloser) error + WriteFile(ctx context.Context, uid, gid, path, source string) error + ListDeletedEntries(ctx context.Context, uid, gid string) ([]*DeletedEntry, error) + RestoreDeletedEntry(ctx context.Context, uid, gid, key string) error + PurgeDeletedEntries(ctx context.Context, uid, gid string) error + ListVersions(ctx context.Context, uid, gid, p string) ([]*FileInfo, error) + RollbackToVersion(ctx context.Context, uid, gid, path, version string) error + ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error) +} // AttrType is the type of extended attribute, // either system (sys) or user (user). type AttrType uint32 -type eosVersion string - -const ( - // SystemAttr is the system extended attribute. - SystemAttr AttrType = iota - // UserAttr is the user extended attribute. - UserAttr -) - -func (at AttrType) String() string { - switch at { - case SystemAttr: - return "sys" - case UserAttr: - return "user" - default: - return "invalid" - } -} - // Attribute represents an EOS extended attribute. type Attribute struct { Type AttrType Key, Val string } -func (a *Attribute) serialize() string { - return fmt.Sprintf("%s.%s=%s", a.Type, a.Key, a.Val) -} - -func (a *Attribute) isValid() bool { - // validate that an attribute is correct. - if (a.Type != SystemAttr && a.Type != UserAttr) || a.Key == "" { - return false - } - return true -} - -// Options to configure the Client. -type Options struct { - - // ForceSingleUserMode forces all connections to use only one user. - // This is the case when access to EOS is done from FUSE under apache or www-data. - ForceSingleUserMode bool - - // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. - UseKeytab bool - - // Whether to maintain the same inode across various versions of a file. - // Requires extra metadata operations if set to true - VersionInvariant bool - - // SingleUsername is the username to use when connecting to EOS. - // Defaults to apache - SingleUsername string - - // Location of the eos binary. - // Default is /usr/bin/eos. - EosBinary string - - // Location of the xrdcopy binary. - // Default is /usr/bin/xrdcopy. - XrdcopyBinary string - - // URL of the EOS MGM. - // Default is root://eos-example.org - URL string - - // Location on the local fs where to store reads. - // Defaults to os.TempDir() - CacheDirectory string - - // Keytab is the location of the EOS keytab file. - Keytab string - - // SecProtocol is the comma separated list of security protocols used by xrootd. - // For example: "sss, unix" - SecProtocol string -} - -func (opt *Options) init() { - if opt.ForceSingleUserMode && opt.SingleUsername != "" { - opt.SingleUsername = "apache" - } - - if opt.EosBinary == "" { - opt.EosBinary = "/usr/bin/eos" - } - - if opt.XrdcopyBinary == "" { - opt.XrdcopyBinary = "/usr/bin/xrdcopy" - } - - if opt.URL == "" { - opt.URL = "root://eos-example.org" - } - - if opt.CacheDirectory == "" { - opt.CacheDirectory = os.TempDir() - } -} - -// Client performs actions against a EOS management node (MGM). -// It requires the eos-client and xrootd-client packages installed to work. -type Client struct { - opt *Options -} - -// New creates a new client with the given options. -func New(opt *Options) *Client { - opt.init() - c := new(Client) - c.opt = opt - return c -} - -// exec executes the command and returns the stdout, stderr and return code -func (c *Client) execute(ctx context.Context, cmd *exec.Cmd) (string, string, error) { - log := appctx.GetLogger(ctx) - - outBuf := &bytes.Buffer{} - errBuf := &bytes.Buffer{} - cmd.Stdout = outBuf - cmd.Stderr = errBuf - cmd.Env = []string{ - "EOS_MGM_URL=" + c.opt.URL, - } - - if c.opt.UseKeytab { - cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol) - cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab) - } - - err := cmd.Run() - - var exitStatus int - if exiterr, ok := err.(*exec.ExitError); ok { - // The program has exited with an exit code != 0 - // This works on both Unix and Windows. Although package - // syscall is generally platform dependent, WaitStatus is - // defined for both Unix and Windows and in both cases has - // an ExitStatus() method with the same signature. - if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { - - exitStatus = status.ExitStatus() - switch exitStatus { - case 0: - err = nil - case int(syscall.ENOENT): - err = errtypes.NotFound(errBuf.String()) - } - } - } - - args := fmt.Sprintf("%s", cmd.Args) - env := fmt.Sprintf("%s", cmd.Env) - log.Info().Str("args", args).Str("env", env).Int("exit", exitStatus).Msg("eos cmd") - - if err != nil && exitStatus != int(syscall.ENOENT) { // don't wrap the errtypes.NotFoundError - err = errors.Wrap(err, "eosclient: error while executing command") - } - - return outBuf.String(), errBuf.String(), err -} - -// exec executes only EOS commands the command and returns the stdout, stderr and return code. -// execute() executes arbitrary commands. -func (c *Client) executeEOS(ctx context.Context, cmd *exec.Cmd) (string, string, error) { - log := appctx.GetLogger(ctx) - - outBuf := &bytes.Buffer{} - errBuf := &bytes.Buffer{} - cmd.Stdout = outBuf - cmd.Stderr = errBuf - cmd.Env = []string{ - "EOS_MGM_URL=" + c.opt.URL, - } - if c.opt.UseKeytab { - cmd.Env = append(cmd.Env, "XrdSecPROTOCOL="+c.opt.SecProtocol) - cmd.Env = append(cmd.Env, "XrdSecSSSKT="+c.opt.Keytab) - } - - trace := trace.FromContext(ctx).SpanContext().TraceID.String() - cmd.Args = append(cmd.Args, "--comment", trace) - - err := cmd.Run() - - var exitStatus int - if exiterr, ok := err.(*exec.ExitError); ok { - // The program has exited with an exit code != 0 - // This works on both Unix and Windows. Although package - // syscall is generally platform dependent, WaitStatus is - // defined for both Unix and Windows and in both cases has - // an ExitStatus() method with the same signature. - if status, ok := exiterr.Sys().(syscall.WaitStatus); ok { - exitStatus = status.ExitStatus() - switch exitStatus { - case 0: - err = nil - case int(syscall.ENOENT): - err = errtypes.NotFound(errBuf.String()) - case int(syscall.EPERM), int(syscall.E2BIG), int(syscall.EINVAL): - // eos reports back error code 1 (EPERM) when ? - // eos reports back error code 7 (E2BIG) when the user is not allowed to read the directory - // eos reports back error code 22 (EINVAL) when the user is not allowed to enter the instance - err = errtypes.PermissionDenied(errBuf.String()) - } - } - } - - args := fmt.Sprintf("%s", cmd.Args) - env := fmt.Sprintf("%s", cmd.Env) - log.Info().Str("args", args).Str("env", env).Int("exit", exitStatus).Str("err", errBuf.String()).Msg("eos cmd") - - if err != nil && exitStatus != int(syscall.ENOENT) { // don't wrap the errtypes.NotFoundError - err = errors.Wrap(err, "eosclient: error while executing command") - } - - return outBuf.String(), errBuf.String(), err -} - -func (c *Client) getVersion(ctx context.Context, rootUID, rootGID string) (eosVersion, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "version") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return "", err - } - return c.parseVersion(ctx, stdout), nil -} - -func (c *Client) parseVersion(ctx context.Context, raw string) eosVersion { - var serverVersion string - rawLines := strings.Split(raw, "\n") - for _, rl := range rawLines { - if rl == "" { - continue - } - if strings.HasPrefix(rl, "EOS_SERVER_VERSION") { - serverVersion = strings.Split(strings.Split(rl, " ")[0], "=")[1] - break - } - } - - if strings.HasPrefix(serverVersion, "4.") { - return versionCitrine - } - return versionAquamarine -} - -// AddACL adds an new acl to EOS with the given aclType. -func (c *Client) AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { - version, err := c.getVersion(ctx, rootUID, rootGID) - if err != nil { - return err - } - - var cmd *exec.Cmd - if version == versionCitrine { - sysACL := a.CitrineSerialize() - cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "acl", "--sys", "--recursive", sysACL, path) - } else { - acls, err := c.getACLForPath(ctx, uid, gid, path) - if err != nil { - return err - } - - err = acls.SetEntry(a.Type, a.Qualifier, a.Permissions) - if err != nil { - return err - } - sysACL := acls.Serialize() - cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "attr", "-r", "set", fmt.Sprintf("sys.acl=%s", sysACL), path) - } - - _, _, err = c.executeEOS(ctx, cmd) - return err - -} - -// RemoveACL removes the acl from EOS. -func (c *Client) RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { - version, err := c.getVersion(ctx, rootUID, rootGID) - if err != nil { - return err - } - - var cmd *exec.Cmd - if version == versionCitrine { - sysACL := a.CitrineSerialize() - cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "acl", "--sys", "--recursive", sysACL, path) - } else { - acls, err := c.getACLForPath(ctx, uid, gid, path) - if err != nil { - return err - } - - acls.DeleteEntry(a.Type, a.Qualifier) - sysACL := acls.Serialize() - cmd = exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "attr", "-r", "set", fmt.Sprintf("sys.acl=%s", sysACL), path) - } - - _, _, err = c.executeEOS(ctx, cmd) - return err - -} - -// UpdateACL updates the EOS acl. -func (c *Client) UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { - return c.AddACL(ctx, uid, gid, rootUID, rootGID, path, a) -} - -// GetACL for a file -func (c *Client) GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error) { - acls, err := c.ListACLs(ctx, uid, gid, path) - if err != nil { - return nil, err - } - for _, a := range acls { - if a.Type == aclType && a.Qualifier == target { - return a, nil - } - } - return nil, errtypes.NotFound(fmt.Sprintf("%s:%s", aclType, target)) - -} - -// ListACLs returns the list of ACLs present under the given path. -// EOS returns uids/gid for Citrine version and usernames for older versions. -// For Citire we need to convert back the uid back to username. -func (c *Client) ListACLs(ctx context.Context, uid, gid, path string) ([]*acl.Entry, error) { - - parsedACLs, err := c.getACLForPath(ctx, uid, gid, path) - if err != nil { - return nil, err - } - - // EOS Citrine ACLs are stored with uid. The UID will be resolved to the - // user opaque ID at the eosfs level. - return parsedACLs.Entries, nil -} - -func (c *Client) getACLForPath(ctx context.Context, uid, gid, path string) (*acl.ACLs, error) { - finfo, err := c.GetFileInfoByPath(ctx, uid, gid, path) - if err != nil { - return nil, err - } - - return acl.Parse(finfo.SysACL, acl.ShortTextForm) -} - -// GetFileInfoByInode returns the FileInfo by the given inode -func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*FileInfo, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", fmt.Sprintf("inode:%d", inode), "-m") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, err - } - info, err := c.parseFileInfo(stdout) - if err != nil { - return nil, err - } - - if c.opt.VersionInvariant && isVersionFolder(info.File) { - info, err = c.getFileInfoFromVersion(ctx, uid, gid, info.File) - if err != nil { - return nil, err - } - info.Inode = inode - } - - return info, nil -} - -// GetFileInfoByFXID returns the FileInfo by the given file id in hexadecimal -func (c *Client) GetFileInfoByFXID(ctx context.Context, uid, gid string, fxid string) (*FileInfo, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", fmt.Sprintf("fxid:%s", fxid), "-m") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, err - } - return c.parseFileInfo(stdout) -} - -// SetAttr sets an extended attributes on a path. -func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *Attribute, recursive bool, path string) error { - if !attr.isValid() { - return errors.New("eos: attr is invalid: " + attr.serialize()) - } - var cmd *exec.Cmd - if recursive { - cmd = exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "-r", "set", attr.serialize(), path) - } else { - cmd = exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "set", attr.serialize(), path) - } - - _, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return err - } - return nil -} - -// UnsetAttr unsets an extended attribute on a path. -func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *Attribute, path string) error { - if !attr.isValid() { - return errors.New("eos: attr is invalid: " + attr.serialize()) - } - cmd := exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "attr", "-r", "rm", fmt.Sprintf("%s.%s", attr.Type, attr.Key), path) - _, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return err - } - return nil -} - -// GetFileInfoByPath returns the FilInfo at the given path -func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*FileInfo, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "info", path, "-m") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, err - } - info, err := c.parseFileInfo(stdout) - if err != nil { - return nil, err - } - - if c.opt.VersionInvariant && !isVersionFolder(path) && !info.IsDir { - inode, err := c.getVersionFolderInode(ctx, uid, gid, path) - if err != nil { - return nil, err - } - info.Inode = inode - } - - return info, nil -} - -// GetQuota gets the quota of a user on the quota node defined by path -func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*QuotaInfo, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", rootUID, rootGID, "quota", "ls", "-u", username, "-m") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, err - } - return c.parseQuota(path, stdout) -} - -// Touch creates a 0-size,0-replica file in the EOS namespace. -func (c *Client) Touch(ctx context.Context, uid, gid, path string) error { - cmd := exec.CommandContext(ctx, "/usr/bin/eos", "-r", uid, gid, "file", "touch", path) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// Chown given path -func (c *Client) Chown(ctx context.Context, uid, gid, chownUID, chownGID, path string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "chown", chownUID+":"+chownGID, path) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// Chmod given path -func (c *Client) Chmod(ctx context.Context, uid, gid, mode, path string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "chmod", mode, path) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// CreateDir creates a directory at the given path -func (c *Client) CreateDir(ctx context.Context, uid, gid, path string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "mkdir", "-p", path) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// Remove removes the resource at the given path -func (c *Client) Remove(ctx context.Context, uid, gid, path string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "rm", "-r", path) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// Rename renames the resource referenced by oldPath to newPath -func (c *Client) Rename(ctx context.Context, uid, gid, oldPath, newPath string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "rename", oldPath, newPath) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// List the contents of the directory given by path -func (c *Client) List(ctx context.Context, uid, gid, path string) ([]*FileInfo, error) { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "find", "--fileinfo", "--maxdepth", "1", path) - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, errors.Wrapf(err, "eosclient: error listing fn=%s", path) - } - return c.parseFind(path, stdout) -} - -// Read reads a file from the mgm -func (c *Client) Read(ctx context.Context, uid, gid, path string) (io.ReadCloser, error) { - rand := "eosread-" + uuid.Must(uuid.NewV4()).String() - localTarget := fmt.Sprintf("%s/%s", c.opt.CacheDirectory, rand) - defer os.RemoveAll(localTarget) - - xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) - cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", xrdPath, localTarget, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s", uid, gid)) - _, _, err := c.execute(ctx, cmd) - if err != nil { - return nil, err - } - return os.Open(localTarget) -} - -// Write writes a stream to the mgm -func (c *Client) Write(ctx context.Context, uid, gid, path string, stream io.ReadCloser) error { - fd, err := ioutil.TempFile(c.opt.CacheDirectory, "eoswrite-") - if err != nil { - return err - } - defer fd.Close() - defer os.RemoveAll(fd.Name()) - - // copy stream to local temp file - _, err = io.Copy(fd, stream) - if err != nil { - return err - } - - return c.WriteFile(ctx, uid, gid, path, fd.Name()) -} - -// WriteFile writes an existing file to the mgm -func (c *Client) WriteFile(ctx context.Context, uid, gid, path, source string) error { - xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) - cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", source, xrdPath, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s", uid, gid)) - _, _, err := c.execute(ctx, cmd) - return err -} - -// ListDeletedEntries returns a list of the deleted entries. -func (c *Client) ListDeletedEntries(ctx context.Context, uid, gid string) ([]*DeletedEntry, error) { - // TODO(labkode): add protection if slave is configured and alive to count how many files are in the trashbin before - // triggering the recycle ls call that could break the instance because of unavailable memory. - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "ls", "-m") - stdout, _, err := c.executeEOS(ctx, cmd) - if err != nil { - return nil, err - } - return parseRecycleList(stdout) -} - -// RestoreDeletedEntry restores a deleted entry. -func (c *Client) RestoreDeletedEntry(ctx context.Context, uid, gid, key string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "restore", key) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// PurgeDeletedEntries purges all entries from the recycle bin. -func (c *Client) PurgeDeletedEntries(ctx context.Context, uid, gid string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "recycle", "purge") - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// ListVersions list all the versions for a given file. -func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*FileInfo, error) { - versionFolder := getVersionFolder(p) - finfos, err := c.List(ctx, uid, gid, versionFolder) - if err != nil { - // we send back an empty list - return []*FileInfo{}, nil - } - return finfos, nil -} - -// RollbackToVersion rollbacks a file to a previous version. -func (c *Client) RollbackToVersion(ctx context.Context, uid, gid, path, version string) error { - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "versions", path, version) - _, _, err := c.executeEOS(ctx, cmd) - return err -} - -// ReadVersion reads the version for the given file. -func (c *Client) ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error) { - versionFile := path.Join(getVersionFolder(p), version) - return c.Read(ctx, uid, gid, versionFile) -} - -func (c *Client) getVersionFolderInode(ctx context.Context, uid, gid, p string) (uint64, error) { - versionFolder := getVersionFolder(p) - md, err := c.GetFileInfoByPath(ctx, uid, gid, versionFolder) - if err != nil { - if err = c.CreateDir(ctx, uid, gid, versionFolder); err != nil { - return 0, err - } - md, err = c.GetFileInfoByPath(ctx, uid, gid, versionFolder) - if err != nil { - return 0, err - } - } - return md.Inode, nil -} - -func (c *Client) getFileInfoFromVersion(ctx context.Context, uid, gid, p string) (*FileInfo, error) { - file := getFileFromVersionFolder(p) - md, err := c.GetFileInfoByPath(ctx, uid, gid, file) - if err != nil { - return nil, err - } - return md, nil -} - -func isVersionFolder(p string) bool { - return strings.HasPrefix(path.Base(p), versionPrefix) -} - -func getVersionFolder(p string) string { - return path.Join(path.Dir(p), versionPrefix+path.Base(p)) -} - -func getFileFromVersionFolder(p string) string { - return path.Join(path.Dir(p), strings.TrimPrefix(path.Base(p), versionPrefix)) -} - -func parseRecycleList(raw string) ([]*DeletedEntry, error) { - entries := []*DeletedEntry{} - rawLines := strings.FieldsFunc(raw, func(c rune) bool { - return c == '\n' - }) - for _, rl := range rawLines { - if rl == "" { - continue - } - entry, err := parseRecycleEntry(rl) - if err != nil { - return nil, err - } - entries = append(entries, entry) - } - return entries, nil -} - -// parse entries like these: -// recycle=ls recycle-bin=/eos/backup/proc/recycle/ uid=gonzalhu gid=it size=0 deletion-time=1510823151 type=recursive-dir keylength.restore-path=45 restore-path=/eos/scratch/user/g/gonzalhu/.sys.v#.app.ico/ restore-key=0000000000a35100 -// recycle=ls recycle-bin=/eos/backup/proc/recycle/ uid=gonzalhu gid=it size=381038 deletion-time=1510823151 type=file keylength.restore-path=36 restore-path=/eos/scratch/user/g/gonzalhu/app.ico restore-key=000000002544fdb3 -func parseRecycleEntry(raw string) (*DeletedEntry, error) { - partsBySpace := strings.FieldsFunc(raw, func(c rune) bool { - return c == ' ' - }) - restoreKeyPair, partsBySpace := partsBySpace[len(partsBySpace)-1], partsBySpace[:len(partsBySpace)-1] - restorePathPair := strings.Join(partsBySpace[8:], " ") - - partsBySpace = partsBySpace[:8] - partsBySpace = append(partsBySpace, restorePathPair) - partsBySpace = append(partsBySpace, restoreKeyPair) - - kv := getMap(partsBySpace) - size, err := strconv.ParseUint(kv["size"], 10, 64) - if err != nil { - return nil, err - } - isDir := false - if kv["type"] == "recursive-dir" { - isDir = true - } - deletionMTime, err := strconv.ParseUint(strings.Split(kv["deletion-time"], ".")[0], 10, 64) - if err != nil { - return nil, err - } - entry := &DeletedEntry{ - RestorePath: kv["restore-path"], - RestoreKey: kv["restore-key"], - Size: size, - DeletionMTime: deletionMTime, - IsDir: isDir, - } - return entry, nil -} - -func getMap(partsBySpace []string) map[string]string { - kv := map[string]string{} - for _, pair := range partsBySpace { - parts := strings.Split(pair, "=") - if len(parts) > 1 { - kv[parts[0]] = parts[1] - } - - } - return kv -} - -func (c *Client) parseFind(dirPath, raw string) ([]*FileInfo, error) { - finfos := []*FileInfo{} - rawLines := strings.FieldsFunc(raw, func(c rune) bool { - return c == '\n' - }) - for _, rl := range rawLines { - if rl == "" { - continue - } - fi, err := c.parseFileInfo(rl) - if err != nil { - return nil, err - } - // dirs in eos end with a slash, like /eos/user/g/gonzalhu/ - // we skip the current directory as eos find will return the directory we - // ask to find - if fi.File == path.Clean(dirPath) { - continue - } - finfos = append(finfos, fi) - } - return finfos, nil -} - -func (c Client) parseQuotaLine(line string) map[string]string { - partsBySpace := strings.FieldsFunc(line, func(c rune) bool { - return c == ' ' - }) - m := getMap(partsBySpace) - return m -} -func (c *Client) parseQuota(path, raw string) (*QuotaInfo, error) { - rawLines := strings.FieldsFunc(raw, func(c rune) bool { - return c == '\n' - }) - for _, rl := range rawLines { - if rl == "" { - continue - } - - m := c.parseQuotaLine(rl) - // map[maxbytes:2000000000000 maxlogicalbytes:1000000000000 percentageusedbytes:0.49 quota:node uid:gonzalhu space:/eos/scratch/user/ usedbytes:9829986500 usedlogicalbytes:4914993250 statusfiles:ok usedfiles:334 maxfiles:1000000 statusbytes:ok] - - space := m["space"] - if strings.HasPrefix(path, space) { - maxBytesString := m["maxlogicalbytes"] - usedBytesString := m["usedlogicalbytes"] - maxBytes, _ := strconv.ParseInt(maxBytesString, 10, 64) - usedBytes, _ := strconv.ParseInt(usedBytesString, 10, 64) - - maxInodesString := m["maxfiles"] - usedInodesString := m["usedfiles"] - maxInodes, _ := strconv.ParseInt(maxInodesString, 10, 64) - usedInodes, _ := strconv.ParseInt(usedInodesString, 10, 64) - - qi := &QuotaInfo{ - AvailableBytes: int(maxBytes), - UsedBytes: int(usedBytes), - AvailableInodes: int(maxInodes), - UsedInodes: int(usedInodes), - } - return qi, nil - } - } - return &QuotaInfo{}, nil -} - -// TODO(labkode): better API to access extended attributes. -func (c *Client) parseFileInfo(raw string) (*FileInfo, error) { - - line := raw[15:] - index := strings.Index(line, " file=/") - lengthString := line[0:index] - length, err := strconv.ParseUint(lengthString, 10, 64) - if err != nil { - return nil, err - } - - line = line[index+6:] // skip ' file=' - name := line[0:length] - - kv := make(map[string]string) - // strip trailing slash - kv["file"] = strings.TrimSuffix(name, "/") - - line = line[length+1:] - partsBySpace := strings.FieldsFunc(line, func(c rune) bool { // we have [size=45 container=3 ...} - return c == ' ' - }) - var previousXAttr = "" - for _, p := range partsBySpace { - partsByEqual := strings.Split(p, "=") // we have kv pairs like [size 14] - if len(partsByEqual) == 2 { - // handle xattrn and xattrv special cases - switch { - case partsByEqual[0] == "xattrn": - previousXAttr = partsByEqual[1] - case partsByEqual[0] == "xattrv": - kv[previousXAttr] = partsByEqual[1] - previousXAttr = "" - default: - kv[partsByEqual[0]] = partsByEqual[1] - - } - } - } - - fi, err := c.mapToFileInfo(kv) - if err != nil { - return nil, err - } - return fi, nil -} - -// mapToFileInfo converts the dictionary to an usable structure. -// The kv has format: -// map[sys.forced.space:default files:0 mode:42555 ino:5 sys.forced.blocksize:4k sys.forced.layout:replica uid:0 fid:5 sys.forced.blockchecksum:crc32c sys.recycle:/eos/backup/proc/recycle/ fxid:00000005 pid:1 etag:5:0.000 keylength.file:4 file:/eos treesize:1931593933849913 container:3 gid:0 mtime:1498571294.108614409 ctime:1460121992.294326762 pxid:00000001 sys.forced.checksum:adler sys.forced.nstripes:2] -func (c *Client) mapToFileInfo(kv map[string]string) (*FileInfo, error) { - inode, err := strconv.ParseUint(kv["ino"], 10, 64) - if err != nil { - return nil, err - } - fid, err := strconv.ParseUint(kv["fid"], 10, 64) - if err != nil { - return nil, err - } - uid, err := strconv.ParseUint(kv["uid"], 10, 64) - if err != nil { - return nil, err - } - gid, err := strconv.ParseUint(kv["gid"], 10, 64) - if err != nil { - return nil, err - } - - var treeSize uint64 - // treeSize is only for containers, so we check - if val, ok := kv["treesize"]; ok { - treeSize, err = strconv.ParseUint(val, 10, 64) - if err != nil { - return nil, err - } - } - var fileCounter uint64 - // fileCounter is only for containers - if val, ok := kv["files"]; ok { - fileCounter, err = strconv.ParseUint(val, 10, 64) - if err != nil { - return nil, err - } - } - var dirCounter uint64 - // dirCounter is only for containers - if val, ok := kv["container"]; ok { - dirCounter, err = strconv.ParseUint(val, 10, 64) - if err != nil { - return nil, err - } - } - - // treeCount is the number of entries under the tree - treeCount := fileCounter + dirCounter - - var size uint64 - if val, ok := kv["size"]; ok { - size, err = strconv.ParseUint(val, 10, 64) - if err != nil { - return nil, err - } - } - - // look for the stime first as mtime is not updated for parent dirs; if that isn't set, we use mtime - var mtimesec, mtimenanos uint64 - var mtimeSet bool - if val, ok := kv["stime"]; ok && val != "" { - stimeSplit := strings.Split(val, ".") - if mtimesec, err = strconv.ParseUint(stimeSplit[0], 10, 64); err == nil { - mtimeSet = true - } - if mtimenanos, err = strconv.ParseUint(stimeSplit[1], 10, 32); err != nil { - mtimeSet = false - } - } - if !mtimeSet { - mtimeSplit := strings.Split(kv["mtime"], ".") - if mtimesec, err = strconv.ParseUint(mtimeSplit[0], 10, 64); err != nil { - return nil, err - } - if mtimenanos, err = strconv.ParseUint(mtimeSplit[1], 10, 32); err != nil { - return nil, err - } - } - - isDir := false - if _, ok := kv["files"]; ok { - isDir = true - } - - fi := &FileInfo{ - File: kv["file"], - Inode: inode, - FID: fid, - UID: uid, - GID: gid, - ETag: kv["etag"], - Size: size, - TreeSize: treeSize, - MTimeSec: mtimesec, - MTimeNanos: uint32(mtimenanos), - IsDir: isDir, - Instance: c.opt.URL, - SysACL: kv["sys.acl"], - TreeCount: treeCount, - Attrs: kv, - } - - return fi, nil -} - // FileInfo represents the metadata information returned by querying the EOS namespace. type FileInfo struct { IsDir bool diff --git a/pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.pb.go b/pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.pb.go new file mode 100644 index 0000000000..432587081b --- /dev/null +++ b/pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.pb.go @@ -0,0 +1,3685 @@ +// Copyright 2018-2020 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: eos_grpc.proto + +/* +Package eos_grpc is a generated protocol buffer package. + +It is generated from these files: + eos_grpc.proto + +It has these top-level messages: + PingRequest + PingReply + ContainerInsertRequest + FileInsertRequest + InsertReply + Time + Checksum + FileMdProto + ContainerMdProto + QuotaProto + RoleId + MDId + Limit + MDSelection + MDRequest + MDResponse + FindRequest + ShareAuth + ShareProto + ShareToken + NSRequest + NSResponse + NsStatRequest + NsStatResponse + ManilaRequest + ManilaResponse +*/ +package eos_grpc + +import ( + fmt "fmt" + + proto "github.com/golang/protobuf/proto" + + math "math" + + context "golang.org/x/net/context" + + grpc "google.golang.org/grpc" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +type TYPE int32 + +const ( + TYPE_FILE TYPE = 0 + TYPE_CONTAINER TYPE = 1 + TYPE_LISTING TYPE = 2 + TYPE_STAT TYPE = 3 +) + +var TYPE_name = map[int32]string{ + 0: "FILE", + 1: "CONTAINER", + 2: "LISTING", + 3: "STAT", +} +var TYPE_value = map[string]int32{ + "FILE": 0, + "CONTAINER": 1, + "LISTING": 2, + "STAT": 3, +} + +func (x TYPE) String() string { + return proto.EnumName(TYPE_name, int32(x)) +} +func (TYPE) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +type QUOTATYPE int32 + +const ( + QUOTATYPE_USER QUOTATYPE = 0 + QUOTATYPE_GROUP QUOTATYPE = 2 + QUOTATYPE_PROJECT QUOTATYPE = 3 + QUOTATYPE_ALL QUOTATYPE = 4 +) + +var QUOTATYPE_name = map[int32]string{ + 0: "USER", + 2: "GROUP", + 3: "PROJECT", + 4: "ALL", +} +var QUOTATYPE_value = map[string]int32{ + "USER": 0, + "GROUP": 2, + "PROJECT": 3, + "ALL": 4, +} + +func (x QUOTATYPE) String() string { + return proto.EnumName(QUOTATYPE_name, int32(x)) +} +func (QUOTATYPE) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +type MANILA_REQUEST_TYPE int32 + +const ( + MANILA_REQUEST_TYPE_CREATE_SHARE MANILA_REQUEST_TYPE = 0 + MANILA_REQUEST_TYPE_DELETE_SHARE MANILA_REQUEST_TYPE = 1 + MANILA_REQUEST_TYPE_EXTEND_SHARE MANILA_REQUEST_TYPE = 2 + MANILA_REQUEST_TYPE_SHRINK_SHARE MANILA_REQUEST_TYPE = 3 + MANILA_REQUEST_TYPE_MANAGE_EXISTING MANILA_REQUEST_TYPE = 4 + MANILA_REQUEST_TYPE_UNMANAGE MANILA_REQUEST_TYPE = 5 + MANILA_REQUEST_TYPE_GET_CAPACITIES MANILA_REQUEST_TYPE = 6 +) + +var MANILA_REQUEST_TYPE_name = map[int32]string{ + 0: "CREATE_SHARE", + 1: "DELETE_SHARE", + 2: "EXTEND_SHARE", + 3: "SHRINK_SHARE", + 4: "MANAGE_EXISTING", + 5: "UNMANAGE", + 6: "GET_CAPACITIES", +} +var MANILA_REQUEST_TYPE_value = map[string]int32{ + "CREATE_SHARE": 0, + "DELETE_SHARE": 1, + "EXTEND_SHARE": 2, + "SHRINK_SHARE": 3, + "MANAGE_EXISTING": 4, + "UNMANAGE": 5, + "GET_CAPACITIES": 6, +} + +func (x MANILA_REQUEST_TYPE) String() string { + return proto.EnumName(MANILA_REQUEST_TYPE_name, int32(x)) +} +func (MANILA_REQUEST_TYPE) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +type NSRequest_VersionRequest_VERSION_CMD int32 + +const ( + NSRequest_VersionRequest_CREATE NSRequest_VersionRequest_VERSION_CMD = 0 + NSRequest_VersionRequest_PURGE NSRequest_VersionRequest_VERSION_CMD = 1 + NSRequest_VersionRequest_LIST NSRequest_VersionRequest_VERSION_CMD = 2 +) + +var NSRequest_VersionRequest_VERSION_CMD_name = map[int32]string{ + 0: "CREATE", + 1: "PURGE", + 2: "LIST", +} +var NSRequest_VersionRequest_VERSION_CMD_value = map[string]int32{ + "CREATE": 0, + "PURGE": 1, + "LIST": 2, +} + +func (x NSRequest_VersionRequest_VERSION_CMD) String() string { + return proto.EnumName(NSRequest_VersionRequest_VERSION_CMD_name, int32(x)) +} +func (NSRequest_VersionRequest_VERSION_CMD) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 7, 0} +} + +type NSRequest_RecycleRequest_RECYCLE_CMD int32 + +const ( + NSRequest_RecycleRequest_RESTORE NSRequest_RecycleRequest_RECYCLE_CMD = 0 + NSRequest_RecycleRequest_PURGE NSRequest_RecycleRequest_RECYCLE_CMD = 1 + NSRequest_RecycleRequest_LIST NSRequest_RecycleRequest_RECYCLE_CMD = 2 +) + +var NSRequest_RecycleRequest_RECYCLE_CMD_name = map[int32]string{ + 0: "RESTORE", + 1: "PURGE", + 2: "LIST", +} +var NSRequest_RecycleRequest_RECYCLE_CMD_value = map[string]int32{ + "RESTORE": 0, + "PURGE": 1, + "LIST": 2, +} + +func (x NSRequest_RecycleRequest_RECYCLE_CMD) String() string { + return proto.EnumName(NSRequest_RecycleRequest_RECYCLE_CMD_name, int32(x)) +} +func (NSRequest_RecycleRequest_RECYCLE_CMD) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 8, 0} +} + +type NSRequest_AclRequest_ACL_COMMAND int32 + +const ( + NSRequest_AclRequest_NONE NSRequest_AclRequest_ACL_COMMAND = 0 + NSRequest_AclRequest_MODIFY NSRequest_AclRequest_ACL_COMMAND = 1 + NSRequest_AclRequest_LIST NSRequest_AclRequest_ACL_COMMAND = 2 +) + +var NSRequest_AclRequest_ACL_COMMAND_name = map[int32]string{ + 0: "NONE", + 1: "MODIFY", + 2: "LIST", +} +var NSRequest_AclRequest_ACL_COMMAND_value = map[string]int32{ + "NONE": 0, + "MODIFY": 1, + "LIST": 2, +} + +func (x NSRequest_AclRequest_ACL_COMMAND) String() string { + return proto.EnumName(NSRequest_AclRequest_ACL_COMMAND_name, int32(x)) +} +func (NSRequest_AclRequest_ACL_COMMAND) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 12, 0} +} + +type NSRequest_AclRequest_ACL_TYPE int32 + +const ( + NSRequest_AclRequest_USER_ACL NSRequest_AclRequest_ACL_TYPE = 0 + NSRequest_AclRequest_SYS_ACL NSRequest_AclRequest_ACL_TYPE = 1 +) + +var NSRequest_AclRequest_ACL_TYPE_name = map[int32]string{ + 0: "USER_ACL", + 1: "SYS_ACL", +} +var NSRequest_AclRequest_ACL_TYPE_value = map[string]int32{ + "USER_ACL": 0, + "SYS_ACL": 1, +} + +func (x NSRequest_AclRequest_ACL_TYPE) String() string { + return proto.EnumName(NSRequest_AclRequest_ACL_TYPE_name, int32(x)) +} +func (NSRequest_AclRequest_ACL_TYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 12, 1} +} + +type NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE int32 + +const ( + NSResponse_RecycleResponse_RecycleInfo_FILE NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE = 0 + NSResponse_RecycleResponse_RecycleInfo_TREE NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE = 1 +) + +var NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name = map[int32]string{ + 0: "FILE", + 1: "TREE", +} +var NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_value = map[string]int32{ + "FILE": 0, + "TREE": 1, +} + +func (x NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE) String() string { + return proto.EnumName(NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name, int32(x)) +} +func (NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE) EnumDescriptor() ([]byte, []int) { + return fileDescriptor0, []int{21, 2, 0, 0} +} + +type PingRequest struct { + Authkey string `protobuf:"bytes,1,opt,name=authkey" json:"authkey,omitempty"` + Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *PingRequest) Reset() { *m = PingRequest{} } +func (m *PingRequest) String() string { return proto.CompactTextString(m) } +func (*PingRequest) ProtoMessage() {} +func (*PingRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } + +func (m *PingRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +func (m *PingRequest) GetMessage() []byte { + if m != nil { + return m.Message + } + return nil +} + +type PingReply struct { + Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (m *PingReply) Reset() { *m = PingReply{} } +func (m *PingReply) String() string { return proto.CompactTextString(m) } +func (*PingReply) ProtoMessage() {} +func (*PingReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } + +func (m *PingReply) GetMessage() []byte { + if m != nil { + return m.Message + } + return nil +} + +type ContainerInsertRequest struct { + Container []*ContainerMdProto `protobuf:"bytes,1,rep,name=container" json:"container,omitempty"` + Authkey string `protobuf:"bytes,2,opt,name=authkey" json:"authkey,omitempty"` + InheritMd bool `protobuf:"varint,3,opt,name=inherit_md,json=inheritMd" json:"inherit_md,omitempty"` +} + +func (m *ContainerInsertRequest) Reset() { *m = ContainerInsertRequest{} } +func (m *ContainerInsertRequest) String() string { return proto.CompactTextString(m) } +func (*ContainerInsertRequest) ProtoMessage() {} +func (*ContainerInsertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } + +func (m *ContainerInsertRequest) GetContainer() []*ContainerMdProto { + if m != nil { + return m.Container + } + return nil +} + +func (m *ContainerInsertRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +func (m *ContainerInsertRequest) GetInheritMd() bool { + if m != nil { + return m.InheritMd + } + return false +} + +type FileInsertRequest struct { + Files []*FileMdProto `protobuf:"bytes,1,rep,name=files" json:"files,omitempty"` + Authkey string `protobuf:"bytes,2,opt,name=authkey" json:"authkey,omitempty"` +} + +func (m *FileInsertRequest) Reset() { *m = FileInsertRequest{} } +func (m *FileInsertRequest) String() string { return proto.CompactTextString(m) } +func (*FileInsertRequest) ProtoMessage() {} +func (*FileInsertRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } + +func (m *FileInsertRequest) GetFiles() []*FileMdProto { + if m != nil { + return m.Files + } + return nil +} + +func (m *FileInsertRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +type InsertReply struct { + Message []string `protobuf:"bytes,1,rep,name=message" json:"message,omitempty"` + Retc []uint32 `protobuf:"varint,2,rep,packed,name=retc" json:"retc,omitempty"` +} + +func (m *InsertReply) Reset() { *m = InsertReply{} } +func (m *InsertReply) String() string { return proto.CompactTextString(m) } +func (*InsertReply) ProtoMessage() {} +func (*InsertReply) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } + +func (m *InsertReply) GetMessage() []string { + if m != nil { + return m.Message + } + return nil +} + +func (m *InsertReply) GetRetc() []uint32 { + if m != nil { + return m.Retc + } + return nil +} + +type Time struct { + Sec uint64 `protobuf:"varint,1,opt,name=sec" json:"sec,omitempty"` + NSec uint64 `protobuf:"varint,2,opt,name=n_sec,json=nSec" json:"n_sec,omitempty"` +} + +func (m *Time) Reset() { *m = Time{} } +func (m *Time) String() string { return proto.CompactTextString(m) } +func (*Time) ProtoMessage() {} +func (*Time) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{5} } + +func (m *Time) GetSec() uint64 { + if m != nil { + return m.Sec + } + return 0 +} + +func (m *Time) GetNSec() uint64 { + if m != nil { + return m.NSec + } + return 0 +} + +type Checksum struct { + Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` + Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"` +} + +func (m *Checksum) Reset() { *m = Checksum{} } +func (m *Checksum) String() string { return proto.CompactTextString(m) } +func (*Checksum) ProtoMessage() {} +func (*Checksum) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{6} } + +func (m *Checksum) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +func (m *Checksum) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +type FileMdProto struct { + Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + ContId uint64 `protobuf:"varint,2,opt,name=cont_id,json=contId" json:"cont_id,omitempty"` + Uid uint64 `protobuf:"varint,3,opt,name=uid" json:"uid,omitempty"` + Gid uint64 `protobuf:"varint,4,opt,name=gid" json:"gid,omitempty"` + Size uint64 `protobuf:"varint,5,opt,name=size" json:"size,omitempty"` + LayoutId uint32 `protobuf:"varint,6,opt,name=layout_id,json=layoutId" json:"layout_id,omitempty"` + Flags uint32 `protobuf:"varint,7,opt,name=flags" json:"flags,omitempty"` + Name []byte `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` + LinkName []byte `protobuf:"bytes,9,opt,name=link_name,json=linkName,proto3" json:"link_name,omitempty"` + Ctime *Time `protobuf:"bytes,10,opt,name=ctime" json:"ctime,omitempty"` + Mtime *Time `protobuf:"bytes,11,opt,name=mtime" json:"mtime,omitempty"` + Checksum *Checksum `protobuf:"bytes,12,opt,name=checksum" json:"checksum,omitempty"` + Locations []uint32 `protobuf:"varint,13,rep,packed,name=locations" json:"locations,omitempty"` + UnlinkLocations []uint32 `protobuf:"varint,14,rep,packed,name=unlink_locations,json=unlinkLocations" json:"unlink_locations,omitempty"` + Xattrs map[string][]byte `protobuf:"bytes,15,rep,name=xattrs" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` + Path []byte `protobuf:"bytes,16,opt,name=path,proto3" json:"path,omitempty"` + Etag string `protobuf:"bytes,17,opt,name=etag" json:"etag,omitempty"` +} + +func (m *FileMdProto) Reset() { *m = FileMdProto{} } +func (m *FileMdProto) String() string { return proto.CompactTextString(m) } +func (*FileMdProto) ProtoMessage() {} +func (*FileMdProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{7} } + +func (m *FileMdProto) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *FileMdProto) GetContId() uint64 { + if m != nil { + return m.ContId + } + return 0 +} + +func (m *FileMdProto) GetUid() uint64 { + if m != nil { + return m.Uid + } + return 0 +} + +func (m *FileMdProto) GetGid() uint64 { + if m != nil { + return m.Gid + } + return 0 +} + +func (m *FileMdProto) GetSize() uint64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *FileMdProto) GetLayoutId() uint32 { + if m != nil { + return m.LayoutId + } + return 0 +} + +func (m *FileMdProto) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +func (m *FileMdProto) GetName() []byte { + if m != nil { + return m.Name + } + return nil +} + +func (m *FileMdProto) GetLinkName() []byte { + if m != nil { + return m.LinkName + } + return nil +} + +func (m *FileMdProto) GetCtime() *Time { + if m != nil { + return m.Ctime + } + return nil +} + +func (m *FileMdProto) GetMtime() *Time { + if m != nil { + return m.Mtime + } + return nil +} + +func (m *FileMdProto) GetChecksum() *Checksum { + if m != nil { + return m.Checksum + } + return nil +} + +func (m *FileMdProto) GetLocations() []uint32 { + if m != nil { + return m.Locations + } + return nil +} + +func (m *FileMdProto) GetUnlinkLocations() []uint32 { + if m != nil { + return m.UnlinkLocations + } + return nil +} + +func (m *FileMdProto) GetXattrs() map[string][]byte { + if m != nil { + return m.Xattrs + } + return nil +} + +func (m *FileMdProto) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *FileMdProto) GetEtag() string { + if m != nil { + return m.Etag + } + return "" +} + +type ContainerMdProto struct { + Id uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + ParentId uint64 `protobuf:"varint,2,opt,name=parent_id,json=parentId" json:"parent_id,omitempty"` + Uid uint64 `protobuf:"varint,3,opt,name=uid" json:"uid,omitempty"` + Gid uint64 `protobuf:"varint,4,opt,name=gid" json:"gid,omitempty"` + TreeSize int64 `protobuf:"varint,6,opt,name=tree_size,json=treeSize" json:"tree_size,omitempty"` + Mode uint32 `protobuf:"varint,5,opt,name=mode" json:"mode,omitempty"` + Flags uint32 `protobuf:"varint,7,opt,name=flags" json:"flags,omitempty"` + Name []byte `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` + Ctime *Time `protobuf:"bytes,9,opt,name=ctime" json:"ctime,omitempty"` + Mtime *Time `protobuf:"bytes,10,opt,name=mtime" json:"mtime,omitempty"` + Stime *Time `protobuf:"bytes,11,opt,name=stime" json:"stime,omitempty"` + Xattrs map[string][]byte `protobuf:"bytes,12,rep,name=xattrs" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` + Path []byte `protobuf:"bytes,13,opt,name=path,proto3" json:"path,omitempty"` + Etag string `protobuf:"bytes,14,opt,name=etag" json:"etag,omitempty"` +} + +func (m *ContainerMdProto) Reset() { *m = ContainerMdProto{} } +func (m *ContainerMdProto) String() string { return proto.CompactTextString(m) } +func (*ContainerMdProto) ProtoMessage() {} +func (*ContainerMdProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{8} } + +func (m *ContainerMdProto) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *ContainerMdProto) GetParentId() uint64 { + if m != nil { + return m.ParentId + } + return 0 +} + +func (m *ContainerMdProto) GetUid() uint64 { + if m != nil { + return m.Uid + } + return 0 +} + +func (m *ContainerMdProto) GetGid() uint64 { + if m != nil { + return m.Gid + } + return 0 +} + +func (m *ContainerMdProto) GetTreeSize() int64 { + if m != nil { + return m.TreeSize + } + return 0 +} + +func (m *ContainerMdProto) GetMode() uint32 { + if m != nil { + return m.Mode + } + return 0 +} + +func (m *ContainerMdProto) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +func (m *ContainerMdProto) GetName() []byte { + if m != nil { + return m.Name + } + return nil +} + +func (m *ContainerMdProto) GetCtime() *Time { + if m != nil { + return m.Ctime + } + return nil +} + +func (m *ContainerMdProto) GetMtime() *Time { + if m != nil { + return m.Mtime + } + return nil +} + +func (m *ContainerMdProto) GetStime() *Time { + if m != nil { + return m.Stime + } + return nil +} + +func (m *ContainerMdProto) GetXattrs() map[string][]byte { + if m != nil { + return m.Xattrs + } + return nil +} + +func (m *ContainerMdProto) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *ContainerMdProto) GetEtag() string { + if m != nil { + return m.Etag + } + return "" +} + +type QuotaProto struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Type QUOTATYPE `protobuf:"varint,3,opt,name=type,enum=eos.rpc.QUOTATYPE" json:"type,omitempty"` + Usedbytes uint64 `protobuf:"varint,4,opt,name=usedbytes" json:"usedbytes,omitempty"` + Usedlogicalbytes uint64 `protobuf:"varint,5,opt,name=usedlogicalbytes" json:"usedlogicalbytes,omitempty"` + Usedfiles uint64 `protobuf:"varint,6,opt,name=usedfiles" json:"usedfiles,omitempty"` + Maxbytes uint64 `protobuf:"varint,7,opt,name=maxbytes" json:"maxbytes,omitempty"` + Maxlogicalbytes uint64 `protobuf:"varint,8,opt,name=maxlogicalbytes" json:"maxlogicalbytes,omitempty"` + Maxfiles uint64 `protobuf:"varint,9,opt,name=maxfiles" json:"maxfiles,omitempty"` + Percentageusedbytes float32 `protobuf:"fixed32,10,opt,name=percentageusedbytes" json:"percentageusedbytes,omitempty"` + Percentageusedfiles float32 `protobuf:"fixed32,11,opt,name=percentageusedfiles" json:"percentageusedfiles,omitempty"` + Statusbytes string `protobuf:"bytes,12,opt,name=statusbytes" json:"statusbytes,omitempty"` + Statusfiles string `protobuf:"bytes,13,opt,name=statusfiles" json:"statusfiles,omitempty"` +} + +func (m *QuotaProto) Reset() { *m = QuotaProto{} } +func (m *QuotaProto) String() string { return proto.CompactTextString(m) } +func (*QuotaProto) ProtoMessage() {} +func (*QuotaProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{9} } + +func (m *QuotaProto) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *QuotaProto) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *QuotaProto) GetType() QUOTATYPE { + if m != nil { + return m.Type + } + return QUOTATYPE_USER +} + +func (m *QuotaProto) GetUsedbytes() uint64 { + if m != nil { + return m.Usedbytes + } + return 0 +} + +func (m *QuotaProto) GetUsedlogicalbytes() uint64 { + if m != nil { + return m.Usedlogicalbytes + } + return 0 +} + +func (m *QuotaProto) GetUsedfiles() uint64 { + if m != nil { + return m.Usedfiles + } + return 0 +} + +func (m *QuotaProto) GetMaxbytes() uint64 { + if m != nil { + return m.Maxbytes + } + return 0 +} + +func (m *QuotaProto) GetMaxlogicalbytes() uint64 { + if m != nil { + return m.Maxlogicalbytes + } + return 0 +} + +func (m *QuotaProto) GetMaxfiles() uint64 { + if m != nil { + return m.Maxfiles + } + return 0 +} + +func (m *QuotaProto) GetPercentageusedbytes() float32 { + if m != nil { + return m.Percentageusedbytes + } + return 0 +} + +func (m *QuotaProto) GetPercentageusedfiles() float32 { + if m != nil { + return m.Percentageusedfiles + } + return 0 +} + +func (m *QuotaProto) GetStatusbytes() string { + if m != nil { + return m.Statusbytes + } + return "" +} + +func (m *QuotaProto) GetStatusfiles() string { + if m != nil { + return m.Statusfiles + } + return "" +} + +type RoleId struct { + Uid uint64 `protobuf:"varint,1,opt,name=uid" json:"uid,omitempty"` + Gid uint64 `protobuf:"varint,2,opt,name=gid" json:"gid,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username" json:"username,omitempty"` + Groupname string `protobuf:"bytes,4,opt,name=groupname" json:"groupname,omitempty"` +} + +func (m *RoleId) Reset() { *m = RoleId{} } +func (m *RoleId) String() string { return proto.CompactTextString(m) } +func (*RoleId) ProtoMessage() {} +func (*RoleId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{10} } + +func (m *RoleId) GetUid() uint64 { + if m != nil { + return m.Uid + } + return 0 +} + +func (m *RoleId) GetGid() uint64 { + if m != nil { + return m.Gid + } + return 0 +} + +func (m *RoleId) GetUsername() string { + if m != nil { + return m.Username + } + return "" +} + +func (m *RoleId) GetGroupname() string { + if m != nil { + return m.Groupname + } + return "" +} + +type MDId struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Id uint64 `protobuf:"fixed64,2,opt,name=id" json:"id,omitempty"` + Ino uint64 `protobuf:"fixed64,3,opt,name=ino" json:"ino,omitempty"` + Type TYPE `protobuf:"varint,4,opt,name=type,enum=eos.rpc.TYPE" json:"type,omitempty"` +} + +func (m *MDId) Reset() { *m = MDId{} } +func (m *MDId) String() string { return proto.CompactTextString(m) } +func (*MDId) ProtoMessage() {} +func (*MDId) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{11} } + +func (m *MDId) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *MDId) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *MDId) GetIno() uint64 { + if m != nil { + return m.Ino + } + return 0 +} + +func (m *MDId) GetType() TYPE { + if m != nil { + return m.Type + } + return TYPE_FILE +} + +type Limit struct { + Zero bool `protobuf:"varint,1,opt,name=zero" json:"zero,omitempty"` + Min uint64 `protobuf:"varint,2,opt,name=min" json:"min,omitempty"` + Max uint64 `protobuf:"varint,3,opt,name=max" json:"max,omitempty"` +} + +func (m *Limit) Reset() { *m = Limit{} } +func (m *Limit) String() string { return proto.CompactTextString(m) } +func (*Limit) ProtoMessage() {} +func (*Limit) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{12} } + +func (m *Limit) GetZero() bool { + if m != nil { + return m.Zero + } + return false +} + +func (m *Limit) GetMin() uint64 { + if m != nil { + return m.Min + } + return 0 +} + +func (m *Limit) GetMax() uint64 { + if m != nil { + return m.Max + } + return 0 +} + +type MDSelection struct { + Select bool `protobuf:"varint,1,opt,name=select" json:"select,omitempty"` + Ctime *Limit `protobuf:"bytes,2,opt,name=ctime" json:"ctime,omitempty"` + Mtime *Limit `protobuf:"bytes,3,opt,name=mtime" json:"mtime,omitempty"` + Stime *Limit `protobuf:"bytes,4,opt,name=stime" json:"stime,omitempty"` + Size *Limit `protobuf:"bytes,5,opt,name=size" json:"size,omitempty"` + Treesize *Limit `protobuf:"bytes,6,opt,name=treesize" json:"treesize,omitempty"` + Children *Limit `protobuf:"bytes,7,opt,name=children" json:"children,omitempty"` + Locations *Limit `protobuf:"bytes,8,opt,name=locations" json:"locations,omitempty"` + UnlinkedLocations *Limit `protobuf:"bytes,9,opt,name=unlinked_locations,json=unlinkedLocations" json:"unlinked_locations,omitempty"` + Layoutid uint64 `protobuf:"varint,10,opt,name=layoutid" json:"layoutid,omitempty"` + Flags uint64 `protobuf:"varint,11,opt,name=flags" json:"flags,omitempty"` + Symlink bool `protobuf:"varint,12,opt,name=symlink" json:"symlink,omitempty"` + Checksum *Checksum `protobuf:"bytes,13,opt,name=checksum" json:"checksum,omitempty"` + Owner uint32 `protobuf:"varint,14,opt,name=owner" json:"owner,omitempty"` + Group uint32 `protobuf:"varint,15,opt,name=group" json:"group,omitempty"` + OwnerRoot bool `protobuf:"varint,16,opt,name=owner_root,json=ownerRoot" json:"owner_root,omitempty"` + GroupRoot bool `protobuf:"varint,17,opt,name=group_root,json=groupRoot" json:"group_root,omitempty"` + RegexpFilename []byte `protobuf:"bytes,18,opt,name=regexp_filename,json=regexpFilename,proto3" json:"regexp_filename,omitempty"` + RegexpDirname []byte `protobuf:"bytes,19,opt,name=regexp_dirname,json=regexpDirname,proto3" json:"regexp_dirname,omitempty"` + Xattr map[string][]byte `protobuf:"bytes,20,rep,name=xattr" json:"xattr,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (m *MDSelection) Reset() { *m = MDSelection{} } +func (m *MDSelection) String() string { return proto.CompactTextString(m) } +func (*MDSelection) ProtoMessage() {} +func (*MDSelection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{13} } + +func (m *MDSelection) GetSelect() bool { + if m != nil { + return m.Select + } + return false +} + +func (m *MDSelection) GetCtime() *Limit { + if m != nil { + return m.Ctime + } + return nil +} + +func (m *MDSelection) GetMtime() *Limit { + if m != nil { + return m.Mtime + } + return nil +} + +func (m *MDSelection) GetStime() *Limit { + if m != nil { + return m.Stime + } + return nil +} + +func (m *MDSelection) GetSize() *Limit { + if m != nil { + return m.Size + } + return nil +} + +func (m *MDSelection) GetTreesize() *Limit { + if m != nil { + return m.Treesize + } + return nil +} + +func (m *MDSelection) GetChildren() *Limit { + if m != nil { + return m.Children + } + return nil +} + +func (m *MDSelection) GetLocations() *Limit { + if m != nil { + return m.Locations + } + return nil +} + +func (m *MDSelection) GetUnlinkedLocations() *Limit { + if m != nil { + return m.UnlinkedLocations + } + return nil +} + +func (m *MDSelection) GetLayoutid() uint64 { + if m != nil { + return m.Layoutid + } + return 0 +} + +func (m *MDSelection) GetFlags() uint64 { + if m != nil { + return m.Flags + } + return 0 +} + +func (m *MDSelection) GetSymlink() bool { + if m != nil { + return m.Symlink + } + return false +} + +func (m *MDSelection) GetChecksum() *Checksum { + if m != nil { + return m.Checksum + } + return nil +} + +func (m *MDSelection) GetOwner() uint32 { + if m != nil { + return m.Owner + } + return 0 +} + +func (m *MDSelection) GetGroup() uint32 { + if m != nil { + return m.Group + } + return 0 +} + +func (m *MDSelection) GetOwnerRoot() bool { + if m != nil { + return m.OwnerRoot + } + return false +} + +func (m *MDSelection) GetGroupRoot() bool { + if m != nil { + return m.GroupRoot + } + return false +} + +func (m *MDSelection) GetRegexpFilename() []byte { + if m != nil { + return m.RegexpFilename + } + return nil +} + +func (m *MDSelection) GetRegexpDirname() []byte { + if m != nil { + return m.RegexpDirname + } + return nil +} + +func (m *MDSelection) GetXattr() map[string][]byte { + if m != nil { + return m.Xattr + } + return nil +} + +type MDRequest struct { + Type TYPE `protobuf:"varint,1,opt,name=type,enum=eos.rpc.TYPE" json:"type,omitempty"` + Id *MDId `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + Authkey string `protobuf:"bytes,3,opt,name=authkey" json:"authkey,omitempty"` + Role *RoleId `protobuf:"bytes,4,opt,name=role" json:"role,omitempty"` + Selection *MDSelection `protobuf:"bytes,5,opt,name=selection" json:"selection,omitempty"` +} + +func (m *MDRequest) Reset() { *m = MDRequest{} } +func (m *MDRequest) String() string { return proto.CompactTextString(m) } +func (*MDRequest) ProtoMessage() {} +func (*MDRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{14} } + +func (m *MDRequest) GetType() TYPE { + if m != nil { + return m.Type + } + return TYPE_FILE +} + +func (m *MDRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *MDRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +func (m *MDRequest) GetRole() *RoleId { + if m != nil { + return m.Role + } + return nil +} + +func (m *MDRequest) GetSelection() *MDSelection { + if m != nil { + return m.Selection + } + return nil +} + +type MDResponse struct { + Type TYPE `protobuf:"varint,1,opt,name=type,enum=eos.rpc.TYPE" json:"type,omitempty"` + Fmd *FileMdProto `protobuf:"bytes,2,opt,name=fmd" json:"fmd,omitempty"` + Cmd *ContainerMdProto `protobuf:"bytes,3,opt,name=cmd" json:"cmd,omitempty"` +} + +func (m *MDResponse) Reset() { *m = MDResponse{} } +func (m *MDResponse) String() string { return proto.CompactTextString(m) } +func (*MDResponse) ProtoMessage() {} +func (*MDResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{15} } + +func (m *MDResponse) GetType() TYPE { + if m != nil { + return m.Type + } + return TYPE_FILE +} + +func (m *MDResponse) GetFmd() *FileMdProto { + if m != nil { + return m.Fmd + } + return nil +} + +func (m *MDResponse) GetCmd() *ContainerMdProto { + if m != nil { + return m.Cmd + } + return nil +} + +type FindRequest struct { + Type TYPE `protobuf:"varint,1,opt,name=type,enum=eos.rpc.TYPE" json:"type,omitempty"` + Id *MDId `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` + Role *RoleId `protobuf:"bytes,3,opt,name=role" json:"role,omitempty"` + Authkey string `protobuf:"bytes,4,opt,name=authkey" json:"authkey,omitempty"` + Maxdepth uint64 `protobuf:"varint,5,opt,name=maxdepth" json:"maxdepth,omitempty"` + Selection *MDSelection `protobuf:"bytes,6,opt,name=selection" json:"selection,omitempty"` +} + +func (m *FindRequest) Reset() { *m = FindRequest{} } +func (m *FindRequest) String() string { return proto.CompactTextString(m) } +func (*FindRequest) ProtoMessage() {} +func (*FindRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{16} } + +func (m *FindRequest) GetType() TYPE { + if m != nil { + return m.Type + } + return TYPE_FILE +} + +func (m *FindRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *FindRequest) GetRole() *RoleId { + if m != nil { + return m.Role + } + return nil +} + +func (m *FindRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +func (m *FindRequest) GetMaxdepth() uint64 { + if m != nil { + return m.Maxdepth + } + return 0 +} + +func (m *FindRequest) GetSelection() *MDSelection { + if m != nil { + return m.Selection + } + return nil +} + +type ShareAuth struct { + Prot string `protobuf:"bytes,1,opt,name=prot" json:"prot,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` + Host string `protobuf:"bytes,3,opt,name=host" json:"host,omitempty"` +} + +func (m *ShareAuth) Reset() { *m = ShareAuth{} } +func (m *ShareAuth) String() string { return proto.CompactTextString(m) } +func (*ShareAuth) ProtoMessage() {} +func (*ShareAuth) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{17} } + +func (m *ShareAuth) GetProt() string { + if m != nil { + return m.Prot + } + return "" +} + +func (m *ShareAuth) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *ShareAuth) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +type ShareProto struct { + Permission string `protobuf:"bytes,1,opt,name=permission" json:"permission,omitempty"` + Expires uint64 `protobuf:"varint,2,opt,name=expires" json:"expires,omitempty"` + Owner string `protobuf:"bytes,3,opt,name=owner" json:"owner,omitempty"` + Group string `protobuf:"bytes,4,opt,name=group" json:"group,omitempty"` + Generation uint64 `protobuf:"varint,5,opt,name=generation" json:"generation,omitempty"` + Path string `protobuf:"bytes,6,opt,name=path" json:"path,omitempty"` + Allowtree bool `protobuf:"varint,7,opt,name=allowtree" json:"allowtree,omitempty"` + Vtoken string `protobuf:"bytes,8,opt,name=vtoken" json:"vtoken,omitempty"` + Origins []*ShareAuth `protobuf:"bytes,9,rep,name=origins" json:"origins,omitempty"` +} + +func (m *ShareProto) Reset() { *m = ShareProto{} } +func (m *ShareProto) String() string { return proto.CompactTextString(m) } +func (*ShareProto) ProtoMessage() {} +func (*ShareProto) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{18} } + +func (m *ShareProto) GetPermission() string { + if m != nil { + return m.Permission + } + return "" +} + +func (m *ShareProto) GetExpires() uint64 { + if m != nil { + return m.Expires + } + return 0 +} + +func (m *ShareProto) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *ShareProto) GetGroup() string { + if m != nil { + return m.Group + } + return "" +} + +func (m *ShareProto) GetGeneration() uint64 { + if m != nil { + return m.Generation + } + return 0 +} + +func (m *ShareProto) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *ShareProto) GetAllowtree() bool { + if m != nil { + return m.Allowtree + } + return false +} + +func (m *ShareProto) GetVtoken() string { + if m != nil { + return m.Vtoken + } + return "" +} + +func (m *ShareProto) GetOrigins() []*ShareAuth { + if m != nil { + return m.Origins + } + return nil +} + +type ShareToken struct { + Token *ShareProto `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` + Serialized []byte `protobuf:"bytes,3,opt,name=serialized,proto3" json:"serialized,omitempty"` + Seed int32 `protobuf:"varint,4,opt,name=seed" json:"seed,omitempty"` +} + +func (m *ShareToken) Reset() { *m = ShareToken{} } +func (m *ShareToken) String() string { return proto.CompactTextString(m) } +func (*ShareToken) ProtoMessage() {} +func (*ShareToken) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{19} } + +func (m *ShareToken) GetToken() *ShareProto { + if m != nil { + return m.Token + } + return nil +} + +func (m *ShareToken) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +func (m *ShareToken) GetSerialized() []byte { + if m != nil { + return m.Serialized + } + return nil +} + +func (m *ShareToken) GetSeed() int32 { + if m != nil { + return m.Seed + } + return 0 +} + +type NSRequest struct { + Authkey string `protobuf:"bytes,1,opt,name=authkey" json:"authkey,omitempty"` + Role *RoleId `protobuf:"bytes,2,opt,name=role" json:"role,omitempty"` + // Actual request data object + // + // Types that are valid to be assigned to Command: + // *NSRequest_Mkdir + // *NSRequest_Rmdir + // *NSRequest_Touch + // *NSRequest_Unlink + // *NSRequest_Rm + // *NSRequest_Rename + // *NSRequest_Symlink + // *NSRequest_Version + // *NSRequest_Recycle + // *NSRequest_Xattr + // *NSRequest_Chown + // *NSRequest_Chmod + // *NSRequest_Acl + // *NSRequest_Token + // *NSRequest_Quota + Command isNSRequest_Command `protobuf_oneof:"command"` +} + +func (m *NSRequest) Reset() { *m = NSRequest{} } +func (m *NSRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest) ProtoMessage() {} +func (*NSRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } + +type isNSRequest_Command interface{ isNSRequest_Command() } + +type NSRequest_Mkdir struct { + Mkdir *NSRequest_MkdirRequest `protobuf:"bytes,21,opt,name=mkdir,oneof"` +} +type NSRequest_Rmdir struct { + Rmdir *NSRequest_RmdirRequest `protobuf:"bytes,22,opt,name=rmdir,oneof"` +} +type NSRequest_Touch struct { + Touch *NSRequest_TouchRequest `protobuf:"bytes,23,opt,name=touch,oneof"` +} +type NSRequest_Unlink struct { + Unlink *NSRequest_UnlinkRequest `protobuf:"bytes,24,opt,name=unlink,oneof"` +} +type NSRequest_Rm struct { + Rm *NSRequest_RmRequest `protobuf:"bytes,25,opt,name=rm,oneof"` +} +type NSRequest_Rename struct { + Rename *NSRequest_RenameRequest `protobuf:"bytes,26,opt,name=rename,oneof"` +} +type NSRequest_Symlink struct { + Symlink *NSRequest_SymlinkRequest `protobuf:"bytes,27,opt,name=symlink,oneof"` +} +type NSRequest_Version struct { + Version *NSRequest_VersionRequest `protobuf:"bytes,28,opt,name=version,oneof"` +} +type NSRequest_Recycle struct { + Recycle *NSRequest_RecycleRequest `protobuf:"bytes,29,opt,name=recycle,oneof"` +} +type NSRequest_Xattr struct { + Xattr *NSRequest_SetXAttrRequest `protobuf:"bytes,30,opt,name=xattr,oneof"` +} +type NSRequest_Chown struct { + Chown *NSRequest_ChownRequest `protobuf:"bytes,31,opt,name=chown,oneof"` +} +type NSRequest_Chmod struct { + Chmod *NSRequest_ChmodRequest `protobuf:"bytes,32,opt,name=chmod,oneof"` +} +type NSRequest_Acl struct { + Acl *NSRequest_AclRequest `protobuf:"bytes,33,opt,name=acl,oneof"` +} +type NSRequest_Token struct { + Token *NSRequest_TokenRequest `protobuf:"bytes,34,opt,name=token,oneof"` +} +type NSRequest_Quota struct { + Quota *NSRequest_QuotaRequest `protobuf:"bytes,35,opt,name=quota,oneof"` +} + +func (*NSRequest_Mkdir) isNSRequest_Command() {} +func (*NSRequest_Rmdir) isNSRequest_Command() {} +func (*NSRequest_Touch) isNSRequest_Command() {} +func (*NSRequest_Unlink) isNSRequest_Command() {} +func (*NSRequest_Rm) isNSRequest_Command() {} +func (*NSRequest_Rename) isNSRequest_Command() {} +func (*NSRequest_Symlink) isNSRequest_Command() {} +func (*NSRequest_Version) isNSRequest_Command() {} +func (*NSRequest_Recycle) isNSRequest_Command() {} +func (*NSRequest_Xattr) isNSRequest_Command() {} +func (*NSRequest_Chown) isNSRequest_Command() {} +func (*NSRequest_Chmod) isNSRequest_Command() {} +func (*NSRequest_Acl) isNSRequest_Command() {} +func (*NSRequest_Token) isNSRequest_Command() {} +func (*NSRequest_Quota) isNSRequest_Command() {} + +func (m *NSRequest) GetCommand() isNSRequest_Command { + if m != nil { + return m.Command + } + return nil +} + +func (m *NSRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +func (m *NSRequest) GetRole() *RoleId { + if m != nil { + return m.Role + } + return nil +} + +func (m *NSRequest) GetMkdir() *NSRequest_MkdirRequest { + if x, ok := m.GetCommand().(*NSRequest_Mkdir); ok { + return x.Mkdir + } + return nil +} + +func (m *NSRequest) GetRmdir() *NSRequest_RmdirRequest { + if x, ok := m.GetCommand().(*NSRequest_Rmdir); ok { + return x.Rmdir + } + return nil +} + +func (m *NSRequest) GetTouch() *NSRequest_TouchRequest { + if x, ok := m.GetCommand().(*NSRequest_Touch); ok { + return x.Touch + } + return nil +} + +func (m *NSRequest) GetUnlink() *NSRequest_UnlinkRequest { + if x, ok := m.GetCommand().(*NSRequest_Unlink); ok { + return x.Unlink + } + return nil +} + +func (m *NSRequest) GetRm() *NSRequest_RmRequest { + if x, ok := m.GetCommand().(*NSRequest_Rm); ok { + return x.Rm + } + return nil +} + +func (m *NSRequest) GetRename() *NSRequest_RenameRequest { + if x, ok := m.GetCommand().(*NSRequest_Rename); ok { + return x.Rename + } + return nil +} + +func (m *NSRequest) GetSymlink() *NSRequest_SymlinkRequest { + if x, ok := m.GetCommand().(*NSRequest_Symlink); ok { + return x.Symlink + } + return nil +} + +func (m *NSRequest) GetVersion() *NSRequest_VersionRequest { + if x, ok := m.GetCommand().(*NSRequest_Version); ok { + return x.Version + } + return nil +} + +func (m *NSRequest) GetRecycle() *NSRequest_RecycleRequest { + if x, ok := m.GetCommand().(*NSRequest_Recycle); ok { + return x.Recycle + } + return nil +} + +func (m *NSRequest) GetXattr() *NSRequest_SetXAttrRequest { + if x, ok := m.GetCommand().(*NSRequest_Xattr); ok { + return x.Xattr + } + return nil +} + +func (m *NSRequest) GetChown() *NSRequest_ChownRequest { + if x, ok := m.GetCommand().(*NSRequest_Chown); ok { + return x.Chown + } + return nil +} + +func (m *NSRequest) GetChmod() *NSRequest_ChmodRequest { + if x, ok := m.GetCommand().(*NSRequest_Chmod); ok { + return x.Chmod + } + return nil +} + +func (m *NSRequest) GetAcl() *NSRequest_AclRequest { + if x, ok := m.GetCommand().(*NSRequest_Acl); ok { + return x.Acl + } + return nil +} + +func (m *NSRequest) GetToken() *NSRequest_TokenRequest { + if x, ok := m.GetCommand().(*NSRequest_Token); ok { + return x.Token + } + return nil +} + +func (m *NSRequest) GetQuota() *NSRequest_QuotaRequest { + if x, ok := m.GetCommand().(*NSRequest_Quota); ok { + return x.Quota + } + return nil +} + +// XXX_OneofFuncs is for the internal use of the proto package. +func (*NSRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { + return _NSRequest_OneofMarshaler, _NSRequest_OneofUnmarshaler, _NSRequest_OneofSizer, []interface{}{ + (*NSRequest_Mkdir)(nil), + (*NSRequest_Rmdir)(nil), + (*NSRequest_Touch)(nil), + (*NSRequest_Unlink)(nil), + (*NSRequest_Rm)(nil), + (*NSRequest_Rename)(nil), + (*NSRequest_Symlink)(nil), + (*NSRequest_Version)(nil), + (*NSRequest_Recycle)(nil), + (*NSRequest_Xattr)(nil), + (*NSRequest_Chown)(nil), + (*NSRequest_Chmod)(nil), + (*NSRequest_Acl)(nil), + (*NSRequest_Token)(nil), + (*NSRequest_Quota)(nil), + } +} + +func _NSRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { + m := msg.(*NSRequest) + // command + switch x := m.Command.(type) { + case *NSRequest_Mkdir: + b.EncodeVarint(21<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Mkdir); err != nil { + return err + } + case *NSRequest_Rmdir: + b.EncodeVarint(22<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rmdir); err != nil { + return err + } + case *NSRequest_Touch: + b.EncodeVarint(23<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Touch); err != nil { + return err + } + case *NSRequest_Unlink: + b.EncodeVarint(24<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Unlink); err != nil { + return err + } + case *NSRequest_Rm: + b.EncodeVarint(25<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rm); err != nil { + return err + } + case *NSRequest_Rename: + b.EncodeVarint(26<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Rename); err != nil { + return err + } + case *NSRequest_Symlink: + b.EncodeVarint(27<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Symlink); err != nil { + return err + } + case *NSRequest_Version: + b.EncodeVarint(28<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Version); err != nil { + return err + } + case *NSRequest_Recycle: + b.EncodeVarint(29<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Recycle); err != nil { + return err + } + case *NSRequest_Xattr: + b.EncodeVarint(30<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Xattr); err != nil { + return err + } + case *NSRequest_Chown: + b.EncodeVarint(31<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Chown); err != nil { + return err + } + case *NSRequest_Chmod: + b.EncodeVarint(32<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Chmod); err != nil { + return err + } + case *NSRequest_Acl: + b.EncodeVarint(33<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Acl); err != nil { + return err + } + case *NSRequest_Token: + b.EncodeVarint(34<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Token); err != nil { + return err + } + case *NSRequest_Quota: + b.EncodeVarint(35<<3 | proto.WireBytes) + if err := b.EncodeMessage(x.Quota); err != nil { + return err + } + case nil: + default: + return fmt.Errorf("NSRequest.Command has unexpected type %T", x) + } + return nil +} + +func _NSRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { + m := msg.(*NSRequest) + switch tag { + case 21: // command.mkdir + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_MkdirRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Mkdir{msg} + return true, err + case 22: // command.rmdir + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_RmdirRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Rmdir{msg} + return true, err + case 23: // command.touch + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_TouchRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Touch{msg} + return true, err + case 24: // command.unlink + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_UnlinkRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Unlink{msg} + return true, err + case 25: // command.rm + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_RmRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Rm{msg} + return true, err + case 26: // command.rename + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_RenameRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Rename{msg} + return true, err + case 27: // command.symlink + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_SymlinkRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Symlink{msg} + return true, err + case 28: // command.version + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_VersionRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Version{msg} + return true, err + case 29: // command.recycle + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_RecycleRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Recycle{msg} + return true, err + case 30: // command.xattr + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_SetXAttrRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Xattr{msg} + return true, err + case 31: // command.chown + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_ChownRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Chown{msg} + return true, err + case 32: // command.chmod + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_ChmodRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Chmod{msg} + return true, err + case 33: // command.acl + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_AclRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Acl{msg} + return true, err + case 34: // command.token + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_TokenRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Token{msg} + return true, err + case 35: // command.quota + if wire != proto.WireBytes { + return true, proto.ErrInternalBadWireType + } + msg := new(NSRequest_QuotaRequest) + err := b.DecodeMessage(msg) + m.Command = &NSRequest_Quota{msg} + return true, err + default: + return false, nil + } +} + +func _NSRequest_OneofSizer(msg proto.Message) (n int) { + m := msg.(*NSRequest) + // command + switch x := m.Command.(type) { + case *NSRequest_Mkdir: + s := proto.Size(x.Mkdir) + n += proto.SizeVarint(21<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Rmdir: + s := proto.Size(x.Rmdir) + n += proto.SizeVarint(22<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Touch: + s := proto.Size(x.Touch) + n += proto.SizeVarint(23<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Unlink: + s := proto.Size(x.Unlink) + n += proto.SizeVarint(24<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Rm: + s := proto.Size(x.Rm) + n += proto.SizeVarint(25<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Rename: + s := proto.Size(x.Rename) + n += proto.SizeVarint(26<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Symlink: + s := proto.Size(x.Symlink) + n += proto.SizeVarint(27<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Version: + s := proto.Size(x.Version) + n += proto.SizeVarint(28<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Recycle: + s := proto.Size(x.Recycle) + n += proto.SizeVarint(29<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Xattr: + s := proto.Size(x.Xattr) + n += proto.SizeVarint(30<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Chown: + s := proto.Size(x.Chown) + n += proto.SizeVarint(31<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Chmod: + s := proto.Size(x.Chmod) + n += proto.SizeVarint(32<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Acl: + s := proto.Size(x.Acl) + n += proto.SizeVarint(33<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Token: + s := proto.Size(x.Token) + n += proto.SizeVarint(34<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case *NSRequest_Quota: + s := proto.Size(x.Quota) + n += proto.SizeVarint(35<<3 | proto.WireBytes) + n += proto.SizeVarint(uint64(s)) + n += s + case nil: + default: + panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) + } + return n +} + +type NSRequest_MkdirRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Recursive bool `protobuf:"varint,2,opt,name=recursive" json:"recursive,omitempty"` + Mode int64 `protobuf:"varint,3,opt,name=mode" json:"mode,omitempty"` +} + +func (m *NSRequest_MkdirRequest) Reset() { *m = NSRequest_MkdirRequest{} } +func (m *NSRequest_MkdirRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_MkdirRequest) ProtoMessage() {} +func (*NSRequest_MkdirRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 0} } + +func (m *NSRequest_MkdirRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_MkdirRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +func (m *NSRequest_MkdirRequest) GetMode() int64 { + if m != nil { + return m.Mode + } + return 0 +} + +type NSRequest_RmdirRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` +} + +func (m *NSRequest_RmdirRequest) Reset() { *m = NSRequest_RmdirRequest{} } +func (m *NSRequest_RmdirRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RmdirRequest) ProtoMessage() {} +func (*NSRequest_RmdirRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 1} } + +func (m *NSRequest_RmdirRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +type NSRequest_TouchRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` +} + +func (m *NSRequest_TouchRequest) Reset() { *m = NSRequest_TouchRequest{} } +func (m *NSRequest_TouchRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_TouchRequest) ProtoMessage() {} +func (*NSRequest_TouchRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 2} } + +func (m *NSRequest_TouchRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +type NSRequest_UnlinkRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Norecycle bool `protobuf:"varint,3,opt,name=norecycle" json:"norecycle,omitempty"` +} + +func (m *NSRequest_UnlinkRequest) Reset() { *m = NSRequest_UnlinkRequest{} } +func (m *NSRequest_UnlinkRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_UnlinkRequest) ProtoMessage() {} +func (*NSRequest_UnlinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 3} } + +func (m *NSRequest_UnlinkRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_UnlinkRequest) GetNorecycle() bool { + if m != nil { + return m.Norecycle + } + return false +} + +type NSRequest_RmRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Recursive bool `protobuf:"varint,2,opt,name=recursive" json:"recursive,omitempty"` + Norecycle bool `protobuf:"varint,3,opt,name=norecycle" json:"norecycle,omitempty"` +} + +func (m *NSRequest_RmRequest) Reset() { *m = NSRequest_RmRequest{} } +func (m *NSRequest_RmRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RmRequest) ProtoMessage() {} +func (*NSRequest_RmRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 4} } + +func (m *NSRequest_RmRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_RmRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +func (m *NSRequest_RmRequest) GetNorecycle() bool { + if m != nil { + return m.Norecycle + } + return false +} + +type NSRequest_RenameRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Target []byte `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` +} + +func (m *NSRequest_RenameRequest) Reset() { *m = NSRequest_RenameRequest{} } +func (m *NSRequest_RenameRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RenameRequest) ProtoMessage() {} +func (*NSRequest_RenameRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 5} } + +func (m *NSRequest_RenameRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_RenameRequest) GetTarget() []byte { + if m != nil { + return m.Target + } + return nil +} + +type NSRequest_SymlinkRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Target []byte `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` +} + +func (m *NSRequest_SymlinkRequest) Reset() { *m = NSRequest_SymlinkRequest{} } +func (m *NSRequest_SymlinkRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_SymlinkRequest) ProtoMessage() {} +func (*NSRequest_SymlinkRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 6} } + +func (m *NSRequest_SymlinkRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_SymlinkRequest) GetTarget() []byte { + if m != nil { + return m.Target + } + return nil +} + +type NSRequest_VersionRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Cmd NSRequest_VersionRequest_VERSION_CMD `protobuf:"varint,2,opt,name=cmd,enum=eos.rpc.NSRequest_VersionRequest_VERSION_CMD" json:"cmd,omitempty"` + Maxversion int32 `protobuf:"varint,3,opt,name=maxversion" json:"maxversion,omitempty"` +} + +func (m *NSRequest_VersionRequest) Reset() { *m = NSRequest_VersionRequest{} } +func (m *NSRequest_VersionRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_VersionRequest) ProtoMessage() {} +func (*NSRequest_VersionRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 7} } + +func (m *NSRequest_VersionRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_VersionRequest) GetCmd() NSRequest_VersionRequest_VERSION_CMD { + if m != nil { + return m.Cmd + } + return NSRequest_VersionRequest_CREATE +} + +func (m *NSRequest_VersionRequest) GetMaxversion() int32 { + if m != nil { + return m.Maxversion + } + return 0 +} + +type NSRequest_RecycleRequest struct { + Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` + Cmd NSRequest_RecycleRequest_RECYCLE_CMD `protobuf:"varint,2,opt,name=cmd,enum=eos.rpc.NSRequest_RecycleRequest_RECYCLE_CMD" json:"cmd,omitempty"` + Restoreflag *NSRequest_RecycleRequest_RestoreFlags `protobuf:"bytes,3,opt,name=restoreflag" json:"restoreflag,omitempty"` + Purgedate *NSRequest_RecycleRequest_PurgeDate `protobuf:"bytes,4,opt,name=purgedate" json:"purgedate,omitempty"` +} + +func (m *NSRequest_RecycleRequest) Reset() { *m = NSRequest_RecycleRequest{} } +func (m *NSRequest_RecycleRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RecycleRequest) ProtoMessage() {} +func (*NSRequest_RecycleRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 8} } + +func (m *NSRequest_RecycleRequest) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *NSRequest_RecycleRequest) GetCmd() NSRequest_RecycleRequest_RECYCLE_CMD { + if m != nil { + return m.Cmd + } + return NSRequest_RecycleRequest_RESTORE +} + +func (m *NSRequest_RecycleRequest) GetRestoreflag() *NSRequest_RecycleRequest_RestoreFlags { + if m != nil { + return m.Restoreflag + } + return nil +} + +func (m *NSRequest_RecycleRequest) GetPurgedate() *NSRequest_RecycleRequest_PurgeDate { + if m != nil { + return m.Purgedate + } + return nil +} + +type NSRequest_RecycleRequest_RestoreFlags struct { + Force bool `protobuf:"varint,1,opt,name=force" json:"force,omitempty"` + Mkpath bool `protobuf:"varint,2,opt,name=mkpath" json:"mkpath,omitempty"` + Versions bool `protobuf:"varint,3,opt,name=versions" json:"versions,omitempty"` +} + +func (m *NSRequest_RecycleRequest_RestoreFlags) Reset() { *m = NSRequest_RecycleRequest_RestoreFlags{} } +func (m *NSRequest_RecycleRequest_RestoreFlags) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RecycleRequest_RestoreFlags) ProtoMessage() {} +func (*NSRequest_RecycleRequest_RestoreFlags) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 8, 0} +} + +func (m *NSRequest_RecycleRequest_RestoreFlags) GetForce() bool { + if m != nil { + return m.Force + } + return false +} + +func (m *NSRequest_RecycleRequest_RestoreFlags) GetMkpath() bool { + if m != nil { + return m.Mkpath + } + return false +} + +func (m *NSRequest_RecycleRequest_RestoreFlags) GetVersions() bool { + if m != nil { + return m.Versions + } + return false +} + +type NSRequest_RecycleRequest_PurgeDate struct { + Year int32 `protobuf:"varint,1,opt,name=year" json:"year,omitempty"` + Month int32 `protobuf:"varint,2,opt,name=month" json:"month,omitempty"` + Day int32 `protobuf:"varint,3,opt,name=day" json:"day,omitempty"` +} + +func (m *NSRequest_RecycleRequest_PurgeDate) Reset() { *m = NSRequest_RecycleRequest_PurgeDate{} } +func (m *NSRequest_RecycleRequest_PurgeDate) String() string { return proto.CompactTextString(m) } +func (*NSRequest_RecycleRequest_PurgeDate) ProtoMessage() {} +func (*NSRequest_RecycleRequest_PurgeDate) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{20, 8, 1} +} + +func (m *NSRequest_RecycleRequest_PurgeDate) GetYear() int32 { + if m != nil { + return m.Year + } + return 0 +} + +func (m *NSRequest_RecycleRequest_PurgeDate) GetMonth() int32 { + if m != nil { + return m.Month + } + return 0 +} + +func (m *NSRequest_RecycleRequest_PurgeDate) GetDay() int32 { + if m != nil { + return m.Day + } + return 0 +} + +type NSRequest_SetXAttrRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Xattrs map[string][]byte `protobuf:"bytes,2,rep,name=xattrs" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"` + Recursive bool `protobuf:"varint,3,opt,name=recursive" json:"recursive,omitempty"` + Keystodelete []string `protobuf:"bytes,4,rep,name=keystodelete" json:"keystodelete,omitempty"` +} + +func (m *NSRequest_SetXAttrRequest) Reset() { *m = NSRequest_SetXAttrRequest{} } +func (m *NSRequest_SetXAttrRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_SetXAttrRequest) ProtoMessage() {} +func (*NSRequest_SetXAttrRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 9} } + +func (m *NSRequest_SetXAttrRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_SetXAttrRequest) GetXattrs() map[string][]byte { + if m != nil { + return m.Xattrs + } + return nil +} + +func (m *NSRequest_SetXAttrRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +func (m *NSRequest_SetXAttrRequest) GetKeystodelete() []string { + if m != nil { + return m.Keystodelete + } + return nil +} + +type NSRequest_ChownRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Owner *RoleId `protobuf:"bytes,2,opt,name=owner" json:"owner,omitempty"` +} + +func (m *NSRequest_ChownRequest) Reset() { *m = NSRequest_ChownRequest{} } +func (m *NSRequest_ChownRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_ChownRequest) ProtoMessage() {} +func (*NSRequest_ChownRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 10} } + +func (m *NSRequest_ChownRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_ChownRequest) GetOwner() *RoleId { + if m != nil { + return m.Owner + } + return nil +} + +type NSRequest_ChmodRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Mode int64 `protobuf:"varint,2,opt,name=mode" json:"mode,omitempty"` +} + +func (m *NSRequest_ChmodRequest) Reset() { *m = NSRequest_ChmodRequest{} } +func (m *NSRequest_ChmodRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_ChmodRequest) ProtoMessage() {} +func (*NSRequest_ChmodRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 11} } + +func (m *NSRequest_ChmodRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_ChmodRequest) GetMode() int64 { + if m != nil { + return m.Mode + } + return 0 +} + +type NSRequest_AclRequest struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Cmd NSRequest_AclRequest_ACL_COMMAND `protobuf:"varint,2,opt,name=cmd,enum=eos.rpc.NSRequest_AclRequest_ACL_COMMAND" json:"cmd,omitempty"` + Recursive bool `protobuf:"varint,3,opt,name=recursive" json:"recursive,omitempty"` + Type NSRequest_AclRequest_ACL_TYPE `protobuf:"varint,4,opt,name=type,enum=eos.rpc.NSRequest_AclRequest_ACL_TYPE" json:"type,omitempty"` + Rule string `protobuf:"bytes,5,opt,name=rule" json:"rule,omitempty"` +} + +func (m *NSRequest_AclRequest) Reset() { *m = NSRequest_AclRequest{} } +func (m *NSRequest_AclRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_AclRequest) ProtoMessage() {} +func (*NSRequest_AclRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 12} } + +func (m *NSRequest_AclRequest) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSRequest_AclRequest) GetCmd() NSRequest_AclRequest_ACL_COMMAND { + if m != nil { + return m.Cmd + } + return NSRequest_AclRequest_NONE +} + +func (m *NSRequest_AclRequest) GetRecursive() bool { + if m != nil { + return m.Recursive + } + return false +} + +func (m *NSRequest_AclRequest) GetType() NSRequest_AclRequest_ACL_TYPE { + if m != nil { + return m.Type + } + return NSRequest_AclRequest_USER_ACL +} + +func (m *NSRequest_AclRequest) GetRule() string { + if m != nil { + return m.Rule + } + return "" +} + +type NSRequest_TokenRequest struct { + Token *ShareToken `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` +} + +func (m *NSRequest_TokenRequest) Reset() { *m = NSRequest_TokenRequest{} } +func (m *NSRequest_TokenRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_TokenRequest) ProtoMessage() {} +func (*NSRequest_TokenRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 13} } + +func (m *NSRequest_TokenRequest) GetToken() *ShareToken { + if m != nil { + return m.Token + } + return nil +} + +type NSRequest_QuotaRequest struct { + Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` + Id *RoleId `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"` +} + +func (m *NSRequest_QuotaRequest) Reset() { *m = NSRequest_QuotaRequest{} } +func (m *NSRequest_QuotaRequest) String() string { return proto.CompactTextString(m) } +func (*NSRequest_QuotaRequest) ProtoMessage() {} +func (*NSRequest_QuotaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20, 14} } + +func (m *NSRequest_QuotaRequest) GetPath() []byte { + if m != nil { + return m.Path + } + return nil +} + +func (m *NSRequest_QuotaRequest) GetId() *RoleId { + if m != nil { + return m.Id + } + return nil +} + +type NSResponse struct { + Error *NSResponse_ErrorResponse `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` + Version *NSResponse_VersionResponse `protobuf:"bytes,2,opt,name=version" json:"version,omitempty"` + Recycle *NSResponse_RecycleResponse `protobuf:"bytes,3,opt,name=recycle" json:"recycle,omitempty"` + Acl *NSResponse_AclResponse `protobuf:"bytes,4,opt,name=acl" json:"acl,omitempty"` + Quota *NSResponse_QuotaResponse `protobuf:"bytes,5,opt,name=quota" json:"quota,omitempty"` +} + +func (m *NSResponse) Reset() { *m = NSResponse{} } +func (m *NSResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse) ProtoMessage() {} +func (*NSResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } + +func (m *NSResponse) GetError() *NSResponse_ErrorResponse { + if m != nil { + return m.Error + } + return nil +} + +func (m *NSResponse) GetVersion() *NSResponse_VersionResponse { + if m != nil { + return m.Version + } + return nil +} + +func (m *NSResponse) GetRecycle() *NSResponse_RecycleResponse { + if m != nil { + return m.Recycle + } + return nil +} + +func (m *NSResponse) GetAcl() *NSResponse_AclResponse { + if m != nil { + return m.Acl + } + return nil +} + +func (m *NSResponse) GetQuota() *NSResponse_QuotaResponse { + if m != nil { + return m.Quota + } + return nil +} + +type NSResponse_ErrorResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` +} + +func (m *NSResponse_ErrorResponse) Reset() { *m = NSResponse_ErrorResponse{} } +func (m *NSResponse_ErrorResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse_ErrorResponse) ProtoMessage() {} +func (*NSResponse_ErrorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21, 0} } + +func (m *NSResponse_ErrorResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NSResponse_ErrorResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +type NSResponse_VersionResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` + Versions []*NSResponse_VersionResponse_VersionInfo `protobuf:"bytes,3,rep,name=versions" json:"versions,omitempty"` +} + +func (m *NSResponse_VersionResponse) Reset() { *m = NSResponse_VersionResponse{} } +func (m *NSResponse_VersionResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse_VersionResponse) ProtoMessage() {} +func (*NSResponse_VersionResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21, 1} } + +func (m *NSResponse_VersionResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NSResponse_VersionResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *NSResponse_VersionResponse) GetVersions() []*NSResponse_VersionResponse_VersionInfo { + if m != nil { + return m.Versions + } + return nil +} + +type NSResponse_VersionResponse_VersionInfo struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Mtime *Time `protobuf:"bytes,2,opt,name=mtime" json:"mtime,omitempty"` +} + +func (m *NSResponse_VersionResponse_VersionInfo) Reset() { + *m = NSResponse_VersionResponse_VersionInfo{} +} +func (m *NSResponse_VersionResponse_VersionInfo) String() string { return proto.CompactTextString(m) } +func (*NSResponse_VersionResponse_VersionInfo) ProtoMessage() {} +func (*NSResponse_VersionResponse_VersionInfo) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{21, 1, 0} +} + +func (m *NSResponse_VersionResponse_VersionInfo) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSResponse_VersionResponse_VersionInfo) GetMtime() *Time { + if m != nil { + return m.Mtime + } + return nil +} + +type NSResponse_RecycleResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` + Recycles []*NSResponse_RecycleResponse_RecycleInfo `protobuf:"bytes,3,rep,name=recycles" json:"recycles,omitempty"` +} + +func (m *NSResponse_RecycleResponse) Reset() { *m = NSResponse_RecycleResponse{} } +func (m *NSResponse_RecycleResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse_RecycleResponse) ProtoMessage() {} +func (*NSResponse_RecycleResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21, 2} } + +func (m *NSResponse_RecycleResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NSResponse_RecycleResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *NSResponse_RecycleResponse) GetRecycles() []*NSResponse_RecycleResponse_RecycleInfo { + if m != nil { + return m.Recycles + } + return nil +} + +type NSResponse_RecycleResponse_RecycleInfo struct { + Id *MDId `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"` + Owner *RoleId `protobuf:"bytes,2,opt,name=owner" json:"owner,omitempty"` + Dtime *Time `protobuf:"bytes,3,opt,name=dtime" json:"dtime,omitempty"` + Size uint64 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"` + Type NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE `protobuf:"varint,5,opt,name=type,enum=eos.rpc.NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE" json:"type,omitempty"` + Key string `protobuf:"bytes,6,opt,name=key" json:"key,omitempty"` +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) Reset() { + *m = NSResponse_RecycleResponse_RecycleInfo{} +} +func (m *NSResponse_RecycleResponse_RecycleInfo) String() string { return proto.CompactTextString(m) } +func (*NSResponse_RecycleResponse_RecycleInfo) ProtoMessage() {} +func (*NSResponse_RecycleResponse_RecycleInfo) Descriptor() ([]byte, []int) { + return fileDescriptor0, []int{21, 2, 0} +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetId() *MDId { + if m != nil { + return m.Id + } + return nil +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetOwner() *RoleId { + if m != nil { + return m.Owner + } + return nil +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetDtime() *Time { + if m != nil { + return m.Dtime + } + return nil +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetSize() uint64 { + if m != nil { + return m.Size + } + return 0 +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetType() NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE { + if m != nil { + return m.Type + } + return NSResponse_RecycleResponse_RecycleInfo_FILE +} + +func (m *NSResponse_RecycleResponse_RecycleInfo) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +type NSResponse_AclResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` + Rule string `protobuf:"bytes,3,opt,name=rule" json:"rule,omitempty"` +} + +func (m *NSResponse_AclResponse) Reset() { *m = NSResponse_AclResponse{} } +func (m *NSResponse_AclResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse_AclResponse) ProtoMessage() {} +func (*NSResponse_AclResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21, 3} } + +func (m *NSResponse_AclResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NSResponse_AclResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *NSResponse_AclResponse) GetRule() string { + if m != nil { + return m.Rule + } + return "" +} + +type NSResponse_QuotaResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg,omitempty"` + Quotanode []*QuotaProto `protobuf:"bytes,3,rep,name=quotanode" json:"quotanode,omitempty"` +} + +func (m *NSResponse_QuotaResponse) Reset() { *m = NSResponse_QuotaResponse{} } +func (m *NSResponse_QuotaResponse) String() string { return proto.CompactTextString(m) } +func (*NSResponse_QuotaResponse) ProtoMessage() {} +func (*NSResponse_QuotaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21, 4} } + +func (m *NSResponse_QuotaResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NSResponse_QuotaResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *NSResponse_QuotaResponse) GetQuotanode() []*QuotaProto { + if m != nil { + return m.Quotanode + } + return nil +} + +type NsStatRequest struct { + Authkey string `protobuf:"bytes,1,opt,name=authkey" json:"authkey,omitempty"` +} + +func (m *NsStatRequest) Reset() { *m = NsStatRequest{} } +func (m *NsStatRequest) String() string { return proto.CompactTextString(m) } +func (*NsStatRequest) ProtoMessage() {} +func (*NsStatRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{22} } + +func (m *NsStatRequest) GetAuthkey() string { + if m != nil { + return m.Authkey + } + return "" +} + +type NsStatResponse struct { + Code int64 `protobuf:"varint,1,opt,name=code" json:"code,omitempty"` + Emsg string `protobuf:"bytes,2,opt,name=emsg" json:"emsg,omitempty"` + State string `protobuf:"bytes,3,opt,name=state" json:"state,omitempty"` + Nfiles uint64 `protobuf:"varint,4,opt,name=nfiles" json:"nfiles,omitempty"` + Ncontainers uint64 `protobuf:"varint,5,opt,name=ncontainers" json:"ncontainers,omitempty"` + BootTime uint64 `protobuf:"varint,6,opt,name=boot_time,json=bootTime" json:"boot_time,omitempty"` + CurrentFid uint64 `protobuf:"varint,7,opt,name=current_fid,json=currentFid" json:"current_fid,omitempty"` + CurrentCid uint64 `protobuf:"varint,8,opt,name=current_cid,json=currentCid" json:"current_cid,omitempty"` + MemVirtual uint64 `protobuf:"varint,9,opt,name=mem_virtual,json=memVirtual" json:"mem_virtual,omitempty"` + MemResident uint64 `protobuf:"varint,10,opt,name=mem_resident,json=memResident" json:"mem_resident,omitempty"` + MemShare uint64 `protobuf:"varint,11,opt,name=mem_share,json=memShare" json:"mem_share,omitempty"` + MemGrowth uint64 `protobuf:"varint,12,opt,name=mem_growth,json=memGrowth" json:"mem_growth,omitempty"` + Threads uint64 `protobuf:"varint,13,opt,name=threads" json:"threads,omitempty"` + Fds uint64 `protobuf:"varint,14,opt,name=fds" json:"fds,omitempty"` + Uptime uint64 `protobuf:"varint,15,opt,name=uptime" json:"uptime,omitempty"` +} + +func (m *NsStatResponse) Reset() { *m = NsStatResponse{} } +func (m *NsStatResponse) String() string { return proto.CompactTextString(m) } +func (*NsStatResponse) ProtoMessage() {} +func (*NsStatResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{23} } + +func (m *NsStatResponse) GetCode() int64 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *NsStatResponse) GetEmsg() string { + if m != nil { + return m.Emsg + } + return "" +} + +func (m *NsStatResponse) GetState() string { + if m != nil { + return m.State + } + return "" +} + +func (m *NsStatResponse) GetNfiles() uint64 { + if m != nil { + return m.Nfiles + } + return 0 +} + +func (m *NsStatResponse) GetNcontainers() uint64 { + if m != nil { + return m.Ncontainers + } + return 0 +} + +func (m *NsStatResponse) GetBootTime() uint64 { + if m != nil { + return m.BootTime + } + return 0 +} + +func (m *NsStatResponse) GetCurrentFid() uint64 { + if m != nil { + return m.CurrentFid + } + return 0 +} + +func (m *NsStatResponse) GetCurrentCid() uint64 { + if m != nil { + return m.CurrentCid + } + return 0 +} + +func (m *NsStatResponse) GetMemVirtual() uint64 { + if m != nil { + return m.MemVirtual + } + return 0 +} + +func (m *NsStatResponse) GetMemResident() uint64 { + if m != nil { + return m.MemResident + } + return 0 +} + +func (m *NsStatResponse) GetMemShare() uint64 { + if m != nil { + return m.MemShare + } + return 0 +} + +func (m *NsStatResponse) GetMemGrowth() uint64 { + if m != nil { + return m.MemGrowth + } + return 0 +} + +func (m *NsStatResponse) GetThreads() uint64 { + if m != nil { + return m.Threads + } + return 0 +} + +func (m *NsStatResponse) GetFds() uint64 { + if m != nil { + return m.Fds + } + return 0 +} + +func (m *NsStatResponse) GetUptime() uint64 { + if m != nil { + return m.Uptime + } + return 0 +} + +type ManilaRequest struct { + RequestType MANILA_REQUEST_TYPE `protobuf:"varint,1,opt,name=request_type,json=requestType,enum=eos.rpc.MANILA_REQUEST_TYPE" json:"request_type,omitempty"` + AuthKey string `protobuf:"bytes,2,opt,name=auth_key,json=authKey" json:"auth_key,omitempty"` + Protocol string `protobuf:"bytes,3,opt,name=protocol" json:"protocol,omitempty"` + ShareName string `protobuf:"bytes,4,opt,name=share_name,json=shareName" json:"share_name,omitempty"` + Description string `protobuf:"bytes,5,opt,name=description" json:"description,omitempty"` + ShareId string `protobuf:"bytes,6,opt,name=share_id,json=shareId" json:"share_id,omitempty"` + ShareGroupId string `protobuf:"bytes,7,opt,name=share_group_id,json=shareGroupId" json:"share_group_id,omitempty"` + Quota int32 `protobuf:"varint,8,opt,name=quota" json:"quota,omitempty"` + Creator string `protobuf:"bytes,9,opt,name=creator" json:"creator,omitempty"` + Egroup string `protobuf:"bytes,10,opt,name=egroup" json:"egroup,omitempty"` + AdminEgroup string `protobuf:"bytes,11,opt,name=admin_egroup,json=adminEgroup" json:"admin_egroup,omitempty"` + ShareHost string `protobuf:"bytes,12,opt,name=share_host,json=shareHost" json:"share_host,omitempty"` + ShareLocation string `protobuf:"bytes,13,opt,name=share_location,json=shareLocation" json:"share_location,omitempty"` +} + +func (m *ManilaRequest) Reset() { *m = ManilaRequest{} } +func (m *ManilaRequest) String() string { return proto.CompactTextString(m) } +func (*ManilaRequest) ProtoMessage() {} +func (*ManilaRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{24} } + +func (m *ManilaRequest) GetRequestType() MANILA_REQUEST_TYPE { + if m != nil { + return m.RequestType + } + return MANILA_REQUEST_TYPE_CREATE_SHARE +} + +func (m *ManilaRequest) GetAuthKey() string { + if m != nil { + return m.AuthKey + } + return "" +} + +func (m *ManilaRequest) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *ManilaRequest) GetShareName() string { + if m != nil { + return m.ShareName + } + return "" +} + +func (m *ManilaRequest) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *ManilaRequest) GetShareId() string { + if m != nil { + return m.ShareId + } + return "" +} + +func (m *ManilaRequest) GetShareGroupId() string { + if m != nil { + return m.ShareGroupId + } + return "" +} + +func (m *ManilaRequest) GetQuota() int32 { + if m != nil { + return m.Quota + } + return 0 +} + +func (m *ManilaRequest) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *ManilaRequest) GetEgroup() string { + if m != nil { + return m.Egroup + } + return "" +} + +func (m *ManilaRequest) GetAdminEgroup() string { + if m != nil { + return m.AdminEgroup + } + return "" +} + +func (m *ManilaRequest) GetShareHost() string { + if m != nil { + return m.ShareHost + } + return "" +} + +func (m *ManilaRequest) GetShareLocation() string { + if m != nil { + return m.ShareLocation + } + return "" +} + +type ManilaResponse struct { + Msg string `protobuf:"bytes,1,opt,name=msg" json:"msg,omitempty"` + Code int32 `protobuf:"varint,2,opt,name=code" json:"code,omitempty"` + TotalUsed int64 `protobuf:"varint,3,opt,name=total_used,json=totalUsed" json:"total_used,omitempty"` + TotalCapacity int64 `protobuf:"varint,4,opt,name=total_capacity,json=totalCapacity" json:"total_capacity,omitempty"` + NewShareQuota int64 `protobuf:"varint,5,opt,name=new_share_quota,json=newShareQuota" json:"new_share_quota,omitempty"` + NewSharePath string `protobuf:"bytes,6,opt,name=new_share_path,json=newSharePath" json:"new_share_path,omitempty"` +} + +func (m *ManilaResponse) Reset() { *m = ManilaResponse{} } +func (m *ManilaResponse) String() string { return proto.CompactTextString(m) } +func (*ManilaResponse) ProtoMessage() {} +func (*ManilaResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{25} } + +func (m *ManilaResponse) GetMsg() string { + if m != nil { + return m.Msg + } + return "" +} + +func (m *ManilaResponse) GetCode() int32 { + if m != nil { + return m.Code + } + return 0 +} + +func (m *ManilaResponse) GetTotalUsed() int64 { + if m != nil { + return m.TotalUsed + } + return 0 +} + +func (m *ManilaResponse) GetTotalCapacity() int64 { + if m != nil { + return m.TotalCapacity + } + return 0 +} + +func (m *ManilaResponse) GetNewShareQuota() int64 { + if m != nil { + return m.NewShareQuota + } + return 0 +} + +func (m *ManilaResponse) GetNewSharePath() string { + if m != nil { + return m.NewSharePath + } + return "" +} + +func init() { + proto.RegisterType((*PingRequest)(nil), "eos.rpc.PingRequest") + proto.RegisterType((*PingReply)(nil), "eos.rpc.PingReply") + proto.RegisterType((*ContainerInsertRequest)(nil), "eos.rpc.ContainerInsertRequest") + proto.RegisterType((*FileInsertRequest)(nil), "eos.rpc.FileInsertRequest") + proto.RegisterType((*InsertReply)(nil), "eos.rpc.InsertReply") + proto.RegisterType((*Time)(nil), "eos.rpc.Time") + proto.RegisterType((*Checksum)(nil), "eos.rpc.Checksum") + proto.RegisterType((*FileMdProto)(nil), "eos.rpc.FileMdProto") + proto.RegisterType((*ContainerMdProto)(nil), "eos.rpc.ContainerMdProto") + proto.RegisterType((*QuotaProto)(nil), "eos.rpc.QuotaProto") + proto.RegisterType((*RoleId)(nil), "eos.rpc.RoleId") + proto.RegisterType((*MDId)(nil), "eos.rpc.MDId") + proto.RegisterType((*Limit)(nil), "eos.rpc.Limit") + proto.RegisterType((*MDSelection)(nil), "eos.rpc.MDSelection") + proto.RegisterType((*MDRequest)(nil), "eos.rpc.MDRequest") + proto.RegisterType((*MDResponse)(nil), "eos.rpc.MDResponse") + proto.RegisterType((*FindRequest)(nil), "eos.rpc.FindRequest") + proto.RegisterType((*ShareAuth)(nil), "eos.rpc.ShareAuth") + proto.RegisterType((*ShareProto)(nil), "eos.rpc.ShareProto") + proto.RegisterType((*ShareToken)(nil), "eos.rpc.ShareToken") + proto.RegisterType((*NSRequest)(nil), "eos.rpc.NSRequest") + proto.RegisterType((*NSRequest_MkdirRequest)(nil), "eos.rpc.NSRequest.MkdirRequest") + proto.RegisterType((*NSRequest_RmdirRequest)(nil), "eos.rpc.NSRequest.RmdirRequest") + proto.RegisterType((*NSRequest_TouchRequest)(nil), "eos.rpc.NSRequest.TouchRequest") + proto.RegisterType((*NSRequest_UnlinkRequest)(nil), "eos.rpc.NSRequest.UnlinkRequest") + proto.RegisterType((*NSRequest_RmRequest)(nil), "eos.rpc.NSRequest.RmRequest") + proto.RegisterType((*NSRequest_RenameRequest)(nil), "eos.rpc.NSRequest.RenameRequest") + proto.RegisterType((*NSRequest_SymlinkRequest)(nil), "eos.rpc.NSRequest.SymlinkRequest") + proto.RegisterType((*NSRequest_VersionRequest)(nil), "eos.rpc.NSRequest.VersionRequest") + proto.RegisterType((*NSRequest_RecycleRequest)(nil), "eos.rpc.NSRequest.RecycleRequest") + proto.RegisterType((*NSRequest_RecycleRequest_RestoreFlags)(nil), "eos.rpc.NSRequest.RecycleRequest.RestoreFlags") + proto.RegisterType((*NSRequest_RecycleRequest_PurgeDate)(nil), "eos.rpc.NSRequest.RecycleRequest.PurgeDate") + proto.RegisterType((*NSRequest_SetXAttrRequest)(nil), "eos.rpc.NSRequest.SetXAttrRequest") + proto.RegisterType((*NSRequest_ChownRequest)(nil), "eos.rpc.NSRequest.ChownRequest") + proto.RegisterType((*NSRequest_ChmodRequest)(nil), "eos.rpc.NSRequest.ChmodRequest") + proto.RegisterType((*NSRequest_AclRequest)(nil), "eos.rpc.NSRequest.AclRequest") + proto.RegisterType((*NSRequest_TokenRequest)(nil), "eos.rpc.NSRequest.TokenRequest") + proto.RegisterType((*NSRequest_QuotaRequest)(nil), "eos.rpc.NSRequest.QuotaRequest") + proto.RegisterType((*NSResponse)(nil), "eos.rpc.NSResponse") + proto.RegisterType((*NSResponse_ErrorResponse)(nil), "eos.rpc.NSResponse.ErrorResponse") + proto.RegisterType((*NSResponse_VersionResponse)(nil), "eos.rpc.NSResponse.VersionResponse") + proto.RegisterType((*NSResponse_VersionResponse_VersionInfo)(nil), "eos.rpc.NSResponse.VersionResponse.VersionInfo") + proto.RegisterType((*NSResponse_RecycleResponse)(nil), "eos.rpc.NSResponse.RecycleResponse") + proto.RegisterType((*NSResponse_RecycleResponse_RecycleInfo)(nil), "eos.rpc.NSResponse.RecycleResponse.RecycleInfo") + proto.RegisterType((*NSResponse_AclResponse)(nil), "eos.rpc.NSResponse.AclResponse") + proto.RegisterType((*NSResponse_QuotaResponse)(nil), "eos.rpc.NSResponse.QuotaResponse") + proto.RegisterType((*NsStatRequest)(nil), "eos.rpc.NsStatRequest") + proto.RegisterType((*NsStatResponse)(nil), "eos.rpc.NsStatResponse") + proto.RegisterType((*ManilaRequest)(nil), "eos.rpc.ManilaRequest") + proto.RegisterType((*ManilaResponse)(nil), "eos.rpc.ManilaResponse") + proto.RegisterEnum("eos.rpc.TYPE", TYPE_name, TYPE_value) + proto.RegisterEnum("eos.rpc.QUOTATYPE", QUOTATYPE_name, QUOTATYPE_value) + proto.RegisterEnum("eos.rpc.MANILA_REQUEST_TYPE", MANILA_REQUEST_TYPE_name, MANILA_REQUEST_TYPE_value) + proto.RegisterEnum("eos.rpc.NSRequest_VersionRequest_VERSION_CMD", NSRequest_VersionRequest_VERSION_CMD_name, NSRequest_VersionRequest_VERSION_CMD_value) + proto.RegisterEnum("eos.rpc.NSRequest_RecycleRequest_RECYCLE_CMD", NSRequest_RecycleRequest_RECYCLE_CMD_name, NSRequest_RecycleRequest_RECYCLE_CMD_value) + proto.RegisterEnum("eos.rpc.NSRequest_AclRequest_ACL_COMMAND", NSRequest_AclRequest_ACL_COMMAND_name, NSRequest_AclRequest_ACL_COMMAND_value) + proto.RegisterEnum("eos.rpc.NSRequest_AclRequest_ACL_TYPE", NSRequest_AclRequest_ACL_TYPE_name, NSRequest_AclRequest_ACL_TYPE_value) + proto.RegisterEnum("eos.rpc.NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE", NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name, NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_value) +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Eos service + +type EosClient interface { + // Replies to a ping + Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) + // Replies to MD requests with a stream + MD(ctx context.Context, in *MDRequest, opts ...grpc.CallOption) (Eos_MDClient, error) + // Replies to Find requests with a stream + Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (Eos_FindClient, error) + // Replies to a NsStat operation + NsStat(ctx context.Context, in *NsStatRequest, opts ...grpc.CallOption) (*NsStatResponse, error) + // Replies to an insert + ContainerInsert(ctx context.Context, in *ContainerInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) + FileInsert(ctx context.Context, in *FileInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) + // Replies to a NsRequest operation + Exec(ctx context.Context, in *NSRequest, opts ...grpc.CallOption) (*NSResponse, error) + // Manila Driver + ManilaServerRequest(ctx context.Context, in *ManilaRequest, opts ...grpc.CallOption) (*ManilaResponse, error) +} + +type eosClient struct { + cc *grpc.ClientConn +} + +func NewEosClient(cc *grpc.ClientConn) EosClient { + return &eosClient{cc} +} + +func (c *eosClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) { + out := new(PingReply) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/Ping", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eosClient) MD(ctx context.Context, in *MDRequest, opts ...grpc.CallOption) (Eos_MDClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Eos_serviceDesc.Streams[0], c.cc, "/eos.rpc.Eos/MD", opts...) + if err != nil { + return nil, err + } + x := &eosMDClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Eos_MDClient interface { + Recv() (*MDResponse, error) + grpc.ClientStream +} + +type eosMDClient struct { + grpc.ClientStream +} + +func (x *eosMDClient) Recv() (*MDResponse, error) { + m := new(MDResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *eosClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (Eos_FindClient, error) { + stream, err := grpc.NewClientStream(ctx, &_Eos_serviceDesc.Streams[1], c.cc, "/eos.rpc.Eos/Find", opts...) + if err != nil { + return nil, err + } + x := &eosFindClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Eos_FindClient interface { + Recv() (*MDResponse, error) + grpc.ClientStream +} + +type eosFindClient struct { + grpc.ClientStream +} + +func (x *eosFindClient) Recv() (*MDResponse, error) { + m := new(MDResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *eosClient) NsStat(ctx context.Context, in *NsStatRequest, opts ...grpc.CallOption) (*NsStatResponse, error) { + out := new(NsStatResponse) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/NsStat", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eosClient) ContainerInsert(ctx context.Context, in *ContainerInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) { + out := new(InsertReply) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/ContainerInsert", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eosClient) FileInsert(ctx context.Context, in *FileInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) { + out := new(InsertReply) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/FileInsert", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eosClient) Exec(ctx context.Context, in *NSRequest, opts ...grpc.CallOption) (*NSResponse, error) { + out := new(NSResponse) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/Exec", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *eosClient) ManilaServerRequest(ctx context.Context, in *ManilaRequest, opts ...grpc.CallOption) (*ManilaResponse, error) { + out := new(ManilaResponse) + err := grpc.Invoke(ctx, "/eos.rpc.Eos/ManilaServerRequest", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Eos service + +type EosServer interface { + // Replies to a ping + Ping(context.Context, *PingRequest) (*PingReply, error) + // Replies to MD requests with a stream + MD(*MDRequest, Eos_MDServer) error + // Replies to Find requests with a stream + Find(*FindRequest, Eos_FindServer) error + // Replies to a NsStat operation + NsStat(context.Context, *NsStatRequest) (*NsStatResponse, error) + // Replies to an insert + ContainerInsert(context.Context, *ContainerInsertRequest) (*InsertReply, error) + FileInsert(context.Context, *FileInsertRequest) (*InsertReply, error) + // Replies to a NsRequest operation + Exec(context.Context, *NSRequest) (*NSResponse, error) + // Manila Driver + ManilaServerRequest(context.Context, *ManilaRequest) (*ManilaResponse, error) +} + +func RegisterEosServer(s *grpc.Server, srv EosServer) { + s.RegisterService(&_Eos_serviceDesc, srv) +} + +func _Eos_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).Ping(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/Ping", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).Ping(ctx, req.(*PingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Eos_MD_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(MDRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EosServer).MD(m, &eosMDServer{stream}) +} + +type Eos_MDServer interface { + Send(*MDResponse) error + grpc.ServerStream +} + +type eosMDServer struct { + grpc.ServerStream +} + +func (x *eosMDServer) Send(m *MDResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Eos_Find_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(FindRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(EosServer).Find(m, &eosFindServer{stream}) +} + +type Eos_FindServer interface { + Send(*MDResponse) error + grpc.ServerStream +} + +type eosFindServer struct { + grpc.ServerStream +} + +func (x *eosFindServer) Send(m *MDResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Eos_NsStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NsStatRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).NsStat(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/NsStat", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).NsStat(ctx, req.(*NsStatRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Eos_ContainerInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ContainerInsertRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).ContainerInsert(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/ContainerInsert", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).ContainerInsert(ctx, req.(*ContainerInsertRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Eos_FileInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FileInsertRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).FileInsert(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/FileInsert", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).FileInsert(ctx, req.(*FileInsertRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Eos_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(NSRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).Exec(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/Exec", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).Exec(ctx, req.(*NSRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Eos_ManilaServerRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ManilaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(EosServer).ManilaServerRequest(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/eos.rpc.Eos/ManilaServerRequest", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(EosServer).ManilaServerRequest(ctx, req.(*ManilaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Eos_serviceDesc = grpc.ServiceDesc{ + ServiceName: "eos.rpc.Eos", + HandlerType: (*EosServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Ping", + Handler: _Eos_Ping_Handler, + }, + { + MethodName: "NsStat", + Handler: _Eos_NsStat_Handler, + }, + { + MethodName: "ContainerInsert", + Handler: _Eos_ContainerInsert_Handler, + }, + { + MethodName: "FileInsert", + Handler: _Eos_FileInsert_Handler, + }, + { + MethodName: "Exec", + Handler: _Eos_Exec_Handler, + }, + { + MethodName: "ManilaServerRequest", + Handler: _Eos_ManilaServerRequest_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "MD", + Handler: _Eos_MD_Handler, + ServerStreams: true, + }, + { + StreamName: "Find", + Handler: _Eos_Find_Handler, + ServerStreams: true, + }, + }, + Metadata: "eos_grpc.proto", +} + +func init() { proto.RegisterFile("eos_grpc.proto", fileDescriptor0) } + +var fileDescriptor0 = []byte{ + // 3464 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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c, 0xea, 0x8d, 0x5e, 0x9e, 0xf4, 0x65, 0x92, 0xc1, 0xb0, 0x98, 0xc7, 0xc2, 0xfd, 0xfe, + 0x3c, 0x11, 0xb1, 0x32, 0x71, 0x8e, 0x60, 0x8f, 0xa1, 0x8d, 0xc0, 0x34, 0x9c, 0x78, 0x8e, 0x3d, + 0x95, 0x44, 0x32, 0x63, 0x5c, 0xc2, 0xa7, 0x92, 0x64, 0x6a, 0xae, 0xe5, 0x92, 0x64, 0x22, 0xee, + 0x42, 0xdd, 0xb7, 0xcf, 0xa4, 0x84, 0x35, 0xe9, 0x72, 0x29, 0xcc, 0xb6, 0x60, 0xc3, 0xb7, 0xcf, + 0x0a, 0x8b, 0xd4, 0x89, 0xe4, 0x22, 0x5a, 0x49, 0x91, 0x4b, 0x98, 0x99, 0x14, 0xb9, 0xc2, 0x2f, + 0xe1, 0xd6, 0x4c, 0x44, 0x8e, 0x08, 0x12, 0x7b, 0x22, 0xf2, 0x33, 0xa1, 0x8b, 0x94, 0xf9, 0xa2, + 0xa9, 0xcb, 0x1c, 0x52, 0x70, 0x63, 0x11, 0x87, 0x5c, 0x63, 0x13, 0x1a, 0x71, 0x62, 0x27, 0xf3, + 0x58, 0xca, 0x6e, 0x92, 0xc2, 0x75, 0x54, 0x4e, 0x21, 0x65, 0xb5, 0x74, 0x0a, 0x42, 0x59, 0xaf, + 0xa0, 0xc6, 0xc3, 0xa9, 0xc8, 0x43, 0xad, 0x74, 0x29, 0xd4, 0xca, 0x79, 0xa8, 0x75, 0xa1, 0x3e, + 0x8f, 0x45, 0x44, 0xf6, 0x35, 0x48, 0x58, 0x06, 0xa3, 0xc6, 0x27, 0x51, 0x38, 0x9f, 0xd1, 0x64, + 0x85, 0x26, 0x73, 0x84, 0x35, 0x86, 0xca, 0xe1, 0xee, 0xc0, 0x5d, 0xe8, 0x31, 0x32, 0x23, 0xe0, + 0x32, 0x35, 0xca, 0x08, 0x6d, 0x30, 0xbc, 0x20, 0xa4, 0x05, 0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26, 0x57, 0x10, 0xfb, + 0x39, 0xac, 0x85, 0x91, 0x37, 0xf1, 0x28, 0x59, 0x62, 0x14, 0xe7, 0x2d, 0x52, 0xa6, 0x3f, 0x9e, + 0x92, 0x58, 0x7f, 0x53, 0x52, 0xca, 0x18, 0x11, 0xf3, 0x47, 0x50, 0x95, 0x32, 0x4b, 0x64, 0x94, + 0x5b, 0x45, 0x56, 0xf5, 0x01, 0x2a, 0xd7, 0xb9, 0x07, 0x66, 0xec, 0x4d, 0x02, 0x3b, 0x99, 0x47, + 0x69, 0x60, 0xe7, 0x08, 0x3c, 0x6f, 0x2c, 0x22, 0xcf, 0x9e, 0x7a, 0x3f, 0x08, 0xe9, 0xc2, 0x4d, + 0xae, 0x61, 0xe8, 0x2b, 0x4d, 0x08, 0xd9, 0x7b, 0x57, 0x39, 0x8d, 0xad, 0xbf, 0x7b, 0x07, 0xcc, + 0xa3, 0xe1, 0xea, 0x9b, 0x80, 0xd4, 0x31, 0xcb, 0x57, 0x39, 0xe6, 0xa7, 0x50, 0xf5, 0x5f, 0xbb, + 0x5e, 0xd4, 0xf9, 0x13, 0xa2, 0xca, 0x53, 0x59, 0xb6, 0xc2, 0xf6, 0x21, 0xce, 0x2b, 0xe0, 0xd9, + 0x0d, 0x2e, 0xe9, 0x91, 0x31, 0xf2, 0x91, 0xf1, 0xce, 0x52, 0x46, 0xee, 0x17, 0x19, 0x89, 0x1e, + 0x19, 0x93, 0x70, 0xee, 0x9c, 0x76, 0xde, 0x59, 0xca, 0x38, 0xc2, 0x79, 0x8d, 0x91, 0xe8, 0xd9, + 0xe7, 0x50, 0x93, 0xf5, 0xab, 0xd3, 0x21, 0xce, 0xcd, 0x05, 0x9c, 0xcf, 0x89, 0x20, 0x67, 0x55, + 0x1c, 0x6c, 0x1b, 0xca, 0x91, 0xdf, 0x79, 0x97, 0xf8, 0xee, 0x2d, 0xdc, 0x6a, 0xce, 0x53, 0x8e, + 0x7c, 0x5c, 0x2b, 0x92, 0x85, 0xa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ab, 0xac, 0x29, 0xfd, + 0xad, 0x02, 0x4e, 0xfa, 0x8a, 0x75, 0xe3, 0x97, 0x25, 0xf6, 0x09, 0x54, 0xf6, 0xbc, 0xc0, 0x65, + 0xfa, 0xd3, 0x48, 0xf6, 0xb0, 0xb1, 0x9c, 0xed, 0x0b, 0xa8, 0xc9, 0x1c, 0xcf, 0xee, 0xe4, 0x65, + 0x54, 0x2f, 0x10, 0xdd, 0x77, 0x2e, 0xe1, 0x53, 0x76, 0xf6, 0x1b, 0xd8, 0xb8, 0xf0, 0x6f, 0x18, + 0x7b, 0x70, 0xf9, 0xc5, 0xa5, 0xf0, 0xbb, 0x56, 0x37, 0xdf, 0x9f, 0xf6, 0xbf, 0x95, 0x75, 0x83, + 0xfd, 0x25, 0x40, 0xfe, 0x6f, 0x17, 0xeb, 0x16, 0x1e, 0x78, 0xae, 0x27, 0xe1, 0x63, 0xa8, 0xf4, + 0xcf, 0x84, 0xa3, 0xa9, 0x2d, 0xfb, 0x32, 0xd1, 0xce, 0x9f, 0xf7, 0x08, 0xd6, 0x0d, 0xf6, 0x0c, + 0x6e, 0xc9, 0xb0, 0x1b, 0x8a, 0xe8, 0x8d, 0xc8, 0xbe, 0x77, 0x73, 0x55, 0x14, 0x32, 0xaa, 0xa6, + 0x8a, 0x62, 0xb0, 0x5a, 0x37, 0xbe, 0x7e, 0x02, 0x1b, 0x5e, 0xb8, 0x4d, 0xff, 0xea, 0x29, 0x9a, + 0xaf, 0xeb, 0xfd, 0x30, 0xa6, 0xfa, 0x7b, 0x52, 0xfa, 0xab, 0x7a, 0xfa, 0x27, 0xdf, 0x3f, 0x94, + 0x8d, 0xfe, 0xf1, 0xf0, 0xfb, 0x1a, 0x65, 0xcb, 0x3f, 0xfb, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xf0, 0x6b, 0x20, 0xcf, 0xe2, 0x27, 0x00, 0x00, +} diff --git a/pkg/eosclientgrpc/eos_grpc/eos_grpc.proto b/pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.proto similarity index 96% rename from pkg/eosclientgrpc/eos_grpc/eos_grpc.proto rename to pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.proto index dfc8e6e430..9b67948db2 100644 --- a/pkg/eosclientgrpc/eos_grpc/eos_grpc.proto +++ b/pkg/eosclient/eosgrpc/eos_grpc/eos_grpc.proto @@ -29,13 +29,13 @@ option go_package = "eos_grpc"; service Eos { // Replies to a ping - rpc Ping (PingRequest) returns (PingReply) {} + rpc Ping (PingRequest) returns (PingReply) {} // --------------------------------------------------------------------- // NAMESPACE // --------------------------------------------------------------------- - // Replies to MD requests with a stream + // Replies to MD requests with a stream rpc MD (MDRequest) returns (stream MDResponse) {} // Replies to Find requests with a stream @@ -45,7 +45,7 @@ service Eos { rpc NsStat (NsStatRequest) returns (NsStatResponse) {} // Replies to an insert - rpc ContainerInsert (ContainerInsertRequest) returns (InsertReply) {} + rpc ContainerInsert (ContainerInsertRequest) returns (InsertReply) {} rpc FileInsert (FileInsertRequest) returns (InsertReply) {} // Replies to a NsRequest operation @@ -56,7 +56,7 @@ service Eos { // --------------------------------------------------------------------- // Manila Driver - rpc ManilaServerRequest (ManilaRequest) returns (ManilaResponse) {} + rpc ManilaServerRequest (ManilaRequest) returns (ManilaResponse) {} } message PingRequest { @@ -115,6 +115,7 @@ message FileMdProto { repeated uint32 unlink_locations = 14; map xattrs = 15; bytes path = 16; + string etag = 17; } message ContainerMdProto { @@ -131,13 +132,14 @@ message ContainerMdProto { Time stime = 11; // sync time map xattrs = 12; bytes path = 13; + string etag = 14; } -enum TYPE { FILE = 0; CONTAINER = 1; LISTING = 2; STAT = 3;} +enum TYPE { FILE = 0; CONTAINER = 1; LISTING = 2; STAT = 3;} enum QUOTATYPE { USER = 0; GROUP = 2; PROJECT = 3; ALL = 4;} -message QuotaProto { +message QuotaProto { bytes path = 1; // quota node path string name = 2; // associated name for the given type QUOTATYPE type = 3; // user,group,project or all quota @@ -152,7 +154,7 @@ message QuotaProto { string statusbytes = 12; // status string for volume quota ok,warning,exceeded string statusfiles = 13; // status string for inode quota ok,warning,exceeded } - + message RoleId { uint64 uid = 1; uint64 gid = 2; @@ -213,7 +215,7 @@ message MDResponse { message FindRequest { TYPE type = 1; MDId id = 2; - RoleId role = 3; + RoleId role = 3; string authkey = 4; uint64 maxdepth = 5; MDSelection selection = 6; @@ -251,11 +253,11 @@ message NSRequest { bool recursive = 2; int64 mode = 3; } - + message RmdirRequest { MDId id = 1; } - + message TouchRequest { MDId id = 1; } @@ -293,7 +295,7 @@ message NSRequest { } message RecycleRequest { - string key = 1; + string key = 1; enum RECYCLE_CMD { RESTORE = 0; PURGE = 1; @@ -326,7 +328,7 @@ message NSRequest { message ChownRequest { MDId id = 1; - RoleId owner = 2; + RoleId owner = 2; } message ChmodRequest { @@ -389,7 +391,7 @@ message NSRequest { message NSResponse { message ErrorResponse { int64 code = 1; - string msg = 2; + string msg = 2; } message VersionResponse { @@ -398,14 +400,14 @@ message NSResponse { Time mtime = 2; } int64 code = 1; - string msg = 2; + string msg = 2; repeated VersionInfo versions = 3; } message RecycleResponse { int64 code = 1; - string msg = 2; - + string msg = 2; + message RecycleInfo { enum DELETIONTYPE { FILE = 0; TREE = 1; } MDId id = 1; @@ -414,20 +416,20 @@ message NSResponse { uint64 size = 4; DELETIONTYPE type = 5; string key = 6; - } - + } + repeated RecycleInfo recycles = 3; } message AclResponse { int64 code = 1; - string msg = 2; + string msg = 2; string rule = 3; } message QuotaResponse { - int64 code = 1; - string msg = 2; + int64 code = 1; + string msg = 2; repeated QuotaProto quotanode = 3; } @@ -517,5 +519,3 @@ message ManilaResponse { string new_share_path = 6; } - - diff --git a/pkg/eosclientgrpc/eosclientgrpc.go b/pkg/eosclient/eosgrpc/eosgrpc.go similarity index 60% rename from pkg/eosclientgrpc/eosclientgrpc.go rename to pkg/eosclient/eosgrpc/eosgrpc.go index 0df6b8a949..b566e6954d 100644 --- a/pkg/eosclientgrpc/eosclientgrpc.go +++ b/pkg/eosclient/eosgrpc/eosgrpc.go @@ -16,7 +16,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -package eosclientgrpc +package eosgrpc import ( "bytes" @@ -26,17 +26,20 @@ import ( "io/ioutil" "os" "os/exec" - gouser "os/user" "path" + "path/filepath" "strconv" + "strings" "syscall" "github.com/cs3org/reva/pkg/appctx" - erpc "github.com/cs3org/reva/pkg/eosclientgrpc/eos_grpc" + "github.com/cs3org/reva/pkg/eosclient" + erpc "github.com/cs3org/reva/pkg/eosclient/eosgrpc/eos_grpc" "github.com/cs3org/reva/pkg/errtypes" "github.com/cs3org/reva/pkg/storage/utils/acl" "github.com/gofrs/uuid" "github.com/pkg/errors" + "github.com/rs/zerolog/log" "google.golang.org/grpc" "github.com/cs3org/reva/pkg/logger" @@ -46,34 +49,13 @@ const ( versionPrefix = ".sys.v#." ) -// AttrType is the type of extended attribute, -// either system (sys) or user (user). -type AttrType uint32 - const ( // SystemAttr is the system extended attribute. - SystemAttr AttrType = iota + SystemAttr eosclient.AttrType = iota // UserAttr is the user extended attribute. UserAttr ) -func (at AttrType) String() string { - switch at { - case SystemAttr: - return "sys" - case UserAttr: - return "user" - default: - return "invalid" - } -} - -// Attribute represents an EOS extended attribute. -type Attribute struct { - Type AttrType - Key, Val string -} - // Options to configure the Client. type Options struct { @@ -84,6 +66,10 @@ type Options struct { // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. UseKeytab bool + // Whether to maintain the same inode across various versions of a file. + // Requires extra metadata operations if set to true + VersionInvariant bool + // SingleUsername is the username to use when connecting to EOS. // Defaults to apache SingleUsername string @@ -175,138 +161,78 @@ func newgrpc(ctx context.Context, opt *Options) (erpc.EosClient, error) { // New creates a new client with the given options. func New(opt *Options) *Client { tlog := logger.New().With().Int("pid", os.Getpid()).Logger() - tlog.Debug().Str("Creating new eosgrpc client. opt: ", "'"+fmt.Sprintf("%#v", opt)+"' ").Msg("") opt.init() c := new(Client) c.opt = opt - tctx := appctx.WithLogger(context.Background(), &tlog) - // Let's be successful if the ping was ok. This is an initialization phase // and we enforce the server to be up // This will likely improve as soon as the behaviour of grpc is understood // in the case of server restarts or failures + tctx := appctx.WithLogger(context.Background(), &tlog) ccl, err := newgrpc(tctx, opt) if err != nil { return nil } c.cl = ccl - // Some connection tests, useful for logging in this dev phase - tlog.Debug().Str("Connection tests to: ", "'"+opt.GrpcURI+"' ").Msg("") - - tlog.Debug().Str("Going to stat", "/eos").Msg("") - frep, err := c.GetFileInfoByPath(tctx, "furano", "/eos") - if err != nil { - tlog.Error().Str("GetFileInfoByPath /eos to ", "'"+opt.GrpcURI+"' ").Str("err:", err.Error()).Msg("") - // return nil - } else { - tlog.Info().Str("GetFileInfoByPath /eos to ", "'"+opt.GrpcURI+"' ").Str("resp:", frep.File).Msg("") - } - - tlog.Debug().Str("Going to stat", "/eos-idonotexist").Msg("") - frep1, err := c.GetFileInfoByPath(tctx, "furano", "/eos-idonotexist") - if err != nil { - tlog.Info().Str("GetFileInfoByPath /eos-idonotexist to ", "'"+opt.GrpcURI+"' ").Str("err:", err.Error()).Msg("") - - // return nil - } else { - tlog.Error().Str("GetFileInfoByPath /eos-idonotexist to ", "'"+opt.GrpcURI+"' ").Str("wrong resp:", frep1.File).Msg("") - } - - tlog.Debug().Str("Going to list", "/eos").Msg("") - lrep, err := c.List(context.Background(), "furano", "/eos") - if err != nil { - tlog.Error().Str("List /eos to ", "'"+opt.GrpcURI+"' ").Str("err:", err.Error()).Msg("") - // return nil - } else { - tlog.Info().Str("List /eos to ", "'"+opt.GrpcURI+"' ").Int("nentries:", len(lrep)).Msg("") - } - return c } // Common code to create and initialize a NSRequest -func (c *Client) initNSRequest(username string) (*erpc.NSRequest, error) { +func (c *Client) initNSRequest(uid, gid string) (*erpc.NSRequest, error) { // Stuff filename, uid, gid into the MDRequest type rq := new(erpc.NSRequest) - - // setting of the sys.acl is only possible from root user - unixUser, err := c.getUnixUser(username) - if err != nil { - return nil, err - } rq.Role = new(erpc.RoleId) - uid, err := strconv.ParseUint(unixUser.Uid, 10, 64) + uidInt, err := strconv.ParseUint(uid, 10, 64) if err != nil { return nil, err } - rq.Role.Uid = uid - gid, err := strconv.ParseUint(unixUser.Gid, 10, 64) + gidInt, err := strconv.ParseUint(gid, 10, 64) if err != nil { return nil, err } - rq.Role.Gid = gid - + rq.Role.Uid = uidInt + rq.Role.Gid = gidInt rq.Authkey = c.opt.Authkey return rq, nil } // Common code to create and initialize a NSRequest -func (c *Client) initMDRequest(username string) (*erpc.MDRequest, error) { +func (c *Client) initMDRequest(uid, gid string) (*erpc.MDRequest, error) { // Stuff filename, uid, gid into the MDRequest type mdrq := new(erpc.MDRequest) - - unixUser, err := c.getUnixUser(username) - if err != nil { - return nil, err - } mdrq.Role = new(erpc.RoleId) - uid, err := strconv.ParseUint(unixUser.Uid, 10, 64) + uidInt, err := strconv.ParseUint(uid, 10, 64) if err != nil { return nil, err } - mdrq.Role.Uid = uid - gid, err := strconv.ParseUint(unixUser.Gid, 10, 64) + gidInt, err := strconv.ParseUint(gid, 10, 64) if err != nil { return nil, err } - mdrq.Role.Gid = gid + mdrq.Role.Uid = uidInt + mdrq.Role.Gid = gidInt mdrq.Authkey = c.opt.Authkey return mdrq, nil } -func (c *Client) getUnixUser(username string) (*gouser.User, error) { - if c.opt.ForceSingleUserMode { - username = c.opt.SingleUsername - } - return gouser.Lookup(username) -} - // AddACL adds an new acl to EOS with the given aclType. -func (c *Client) AddACL(ctx context.Context, username, path string, a *acl.Entry) error { +func (c *Client) AddACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { log := appctx.GetLogger(ctx) - acls, err := c.getACLForPath(ctx, username, path) + acls, err := c.getACLForPath(ctx, uid, gid, path) if err != nil { return err } - // since EOS Citrine ACLs are is stored with uid, we need to convert username to uid - // only for users. - if a.Type == acl.TypeUser { - a.Qualifier, err = getUID(a.Qualifier) - if err != nil { - return err - } - } err = acls.SetEntry(a.Type, a.Qualifier, a.Permissions) if err != nil { return err @@ -314,7 +240,7 @@ func (c *Client) AddACL(ctx context.Context, username, path string, a *acl.Entry sysACL := acls.Serialize() // Init a new NSRequest - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -347,29 +273,19 @@ func (c *Client) AddACL(ctx context.Context, username, path string, a *acl.Entry } // RemoveACL removes the acl from EOS. -func (c *Client) RemoveACL(ctx context.Context, username, path string, aclType string, recipient string) error { +func (c *Client) RemoveACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { log := appctx.GetLogger(ctx) - acls, err := c.getACLForPath(ctx, username, path) + acls, err := c.getACLForPath(ctx, uid, gid, path) if err != nil { return err } - // since EOS Citrine ACLs are is stored with uid, we need to convert username to uid - // only for users. - - // since EOS Citrine ACLs are stored with uid, we need to convert username to uid - if aclType == acl.TypeUser { - recipient, err = getUID(recipient) - if err != nil { - return err - } - } - acls.DeleteEntry(aclType, recipient) + acls.DeleteEntry(a.Type, a.Qualifier) sysACL := acls.Serialize() // Init a new NSRequest - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -402,13 +318,13 @@ func (c *Client) RemoveACL(ctx context.Context, username, path string, aclType s } // UpdateACL updates the EOS acl. -func (c *Client) UpdateACL(ctx context.Context, username, path string, a *acl.Entry) error { - return c.AddACL(ctx, username, path, a) +func (c *Client) UpdateACL(ctx context.Context, uid, gid, rootUID, rootGID, path string, a *acl.Entry) error { + return c.AddACL(ctx, uid, gid, path, rootUID, rootGID, a) } // GetACL for a file -func (c *Client) GetACL(ctx context.Context, username, path, aclType, target string) (*acl.Entry, error) { - acls, err := c.ListACLs(ctx, username, path) +func (c *Client) GetACL(ctx context.Context, uid, gid, path, aclType, target string) (*acl.Entry, error) { + acls, err := c.ListACLs(ctx, uid, gid, path) if err != nil { return nil, err } @@ -421,52 +337,25 @@ func (c *Client) GetACL(ctx context.Context, username, path, aclType, target str } -func getUsername(uid string) (string, error) { - user, err := gouser.LookupId(uid) - if err != nil { - return "", err - } - return user.Username, nil -} - -func getUID(username string) (string, error) { - user, err := gouser.Lookup(username) - if err != nil { - return "", err - } - return user.Uid, nil -} - // ListACLs returns the list of ACLs present under the given path. // EOS returns uids/gid for Citrine version and usernames for older versions. // For Citire we need to convert back the uid back to username. -func (c *Client) ListACLs(ctx context.Context, username, path string) ([]*acl.Entry, error) { - log := appctx.GetLogger(ctx) - - parsedACLs, err := c.getACLForPath(ctx, username, path) +func (c *Client) ListACLs(ctx context.Context, uid, gid, path string) ([]*acl.Entry, error) { + parsedACLs, err := c.getACLForPath(ctx, uid, gid, path) if err != nil { return nil, err } - acls := []*acl.Entry{} - for _, acl := range parsedACLs.Entries { - // since EOS Citrine ACLs are is stored with uid, we need to convert uid to username - // TODO map group names as well if acl.Type == "g" ... - acl.Qualifier, err = getUsername(acl.Qualifier) - if err != nil { - log.Warn().Err(err).Str("path", path).Str("username", username).Str("qualifier", acl.Qualifier).Msg("cannot map qualifier to name") - continue - } - acls = append(acls, acl) - } - return acls, nil + // EOS Citrine ACLs are stored with uid. The UID will be resolved to the + // user opaque ID at the eosfs level. + return parsedACLs.Entries, nil } -func (c *Client) getACLForPath(ctx context.Context, username, path string) (*acl.ACLs, error) { +func (c *Client) getACLForPath(ctx context.Context, uid, gid, path string) (*acl.ACLs, error) { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return nil, err } @@ -485,22 +374,22 @@ func (c *Client) getACLForPath(ctx context.Context, username, path string) (*acl resp, err := c.cl.Exec(context.Background(), rq) if err != nil { - log.Error().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Error().Err(err).Str("path", path).Str("err", err.Error()) return nil, err } if resp == nil { - return nil, errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return nil, errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' path: '%s'", uid, path)) } log.Debug().Str("Exec ", "'"+path+"' ").Str("resp:", fmt.Sprintf("%#v", resp)).Msg("") if resp.Acl == nil { - return nil, errtypes.InternalError(fmt.Sprintf("nil acl for username: '%s' path: '%s'", username, path)) + return nil, errtypes.InternalError(fmt.Sprintf("nil acl for uid: '%s' path: '%s'", uid, path)) } if resp.GetError() != nil { - log.Info().Str("username", username).Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Str("uid", uid).Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") } aclret, err := acl.Parse(resp.Acl.Rule, acl.ShortTextForm) @@ -511,11 +400,11 @@ func (c *Client) getACLForPath(ctx context.Context, username, path string) (*acl } // GetFileInfoByInode returns the FileInfo by the given inode -func (c *Client) GetFileInfoByInode(ctx context.Context, username string, inode uint64) (*FileInfo, error) { +func (c *Client) GetFileInfoByInode(ctx context.Context, uid, gid string, inode uint64) (*eosclient.FileInfo, error) { log := appctx.GetLogger(ctx) // Initialize the common fields of the MDReq - mdrq, err := c.initMDRequest(username) + mdrq, err := c.initMDRequest(uid, gid) if err != nil { return nil, err } @@ -542,17 +431,30 @@ func (c *Client) GetFileInfoByInode(ctx context.Context, username string, inode return nil, errtypes.InternalError(fmt.Sprintf("nil response for inode: '%d'", inode)) } - log.Info().Uint64("inode", inode).Msg("grpc response") + log.Info().Uint64("inode", inode).Str("rsp:", fmt.Sprintf("%#v", rsp)).Msg("grpc response") + + info, err := c.grpcMDResponseToFileInfo(rsp, "") + if err != nil { + return nil, err + } + + if c.opt.VersionInvariant && isVersionFolder(info.File) { + info, err = c.getFileInfoFromVersion(ctx, uid, gid, info.File) + if err != nil { + return nil, err + } + info.Inode = inode + } - return c.grpcMDResponseToFileInfo(rsp, "") + return info, nil } // SetAttr sets an extended attributes on a path. -func (c *Client) SetAttr(ctx context.Context, username string, attr *Attribute, recursive bool, path string) error { +func (c *Client) SetAttr(ctx context.Context, uid, gid string, attr *eosclient.Attribute, recursive bool, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -571,26 +473,26 @@ func (c *Client) SetAttr(ctx context.Context, username string, attr *Attribute, // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' gid: '%s' path: '%s'", uid, gid, path)) } - log.Info().Str("username", username).Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") return err } // UnsetAttr unsets an extended attribute on a path. -func (c *Client) UnsetAttr(ctx context.Context, username string, attr *Attribute, path string) error { +func (c *Client) UnsetAttr(ctx context.Context, uid, gid string, attr *eosclient.Attribute, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -608,26 +510,26 @@ func (c *Client) UnsetAttr(ctx context.Context, username string, attr *Attribute // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Error().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Error().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' gid: '%s' path: '%s'", uid, gid, path)) } - log.Info().Str("username", username).Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Str("path", path).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") return err } // GetFileInfoByPath returns the FilInfo at the given path -func (c *Client) GetFileInfoByPath(ctx context.Context, username, path string) (*FileInfo, error) { +func (c *Client) GetFileInfoByPath(ctx context.Context, uid, gid, path string) (*eosclient.FileInfo, error) { log := appctx.GetLogger(ctx) // Initialize the common fields of the MDReq - mdrq, err := c.initMDRequest(username) + mdrq, err := c.initMDRequest(uid, gid) if err != nil { return nil, err } @@ -639,13 +541,13 @@ func (c *Client) GetFileInfoByPath(ctx context.Context, username, path string) ( // Now send the req and see what happens resp, err := c.cl.MD(ctx, mdrq) if err != nil { - log.Error().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Error().Err(err).Str("path", path).Str("err", err.Error()) return nil, err } rsp, err := resp.Recv() if err != nil { - log.Error().Err(err).Str("FIXME username", username).Str("path", path).Str("err", err.Error()) + log.Error().Err(err).Str("path", path).Str("err", err.Error()) // FIXME: this is very very bad and poisonous for the project!!!!!!! // Apparently here we have to assume that an error in Recv() means "file not found" @@ -659,23 +561,39 @@ func (c *Client) GetFileInfoByPath(ctx context.Context, username, path string) ( return nil, errtypes.NotFound(fmt.Sprintf("%s:%s", "acltype", path)) } - log.Info().Str("username", username).Str("path", path).Str("rsp:", fmt.Sprintf("%#v", rsp)).Msg("grpc response") + log.Info().Str("path", path).Str("rsp:", fmt.Sprintf("%#v", rsp)).Msg("grpc response") - return c.grpcMDResponseToFileInfo(rsp, "") + info, err := c.grpcMDResponseToFileInfo(rsp, filepath.Dir(path)) + if err != nil { + return nil, err + } + + if c.opt.VersionInvariant && !isVersionFolder(path) && !info.IsDir { + inode, err := c.getVersionFolderInode(ctx, uid, gid, path) + if err != nil { + return nil, err + } + info.Inode = inode + } + return info, nil +} +// GetFileInfoByFXID returns the FileInfo by the given file id in hexadecimal +func (c *Client) GetFileInfoByFXID(ctx context.Context, uid, gid string, fxid string) (*eosclient.FileInfo, error) { + return nil, errtypes.NotSupported("eosgrpc: GetFileInfoByFXID not implemented") } // GetQuota gets the quota of a user on the quota node defined by path -func (c *Client) GetQuota(ctx context.Context, username, path string) (int, int, error) { - return 0, 0, errtypes.NotSupported(fmt.Sprintf("%s:%s", "acltype", path)) +func (c *Client) GetQuota(ctx context.Context, username, rootUID, rootGID, path string) (*eosclient.QuotaInfo, error) { + return nil, errtypes.NotSupported("eosgrpc: GetQuota not implemented") } // Touch creates a 0-size,0-replica file in the EOS namespace. -func (c *Client) Touch(ctx context.Context, username, path string) error { +func (c *Client) Touch(ctx context.Context, uid, gid, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -690,39 +608,33 @@ func (c *Client) Touch(ctx context.Context, username, path string) error { // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' path: '%s'", uid, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } // Chown given path -func (c *Client) Chown(ctx context.Context, username, chownUser, path string) error { +func (c *Client) Chown(ctx context.Context, uid, gid, chownUID, chownGID, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } msg := new(erpc.NSRequest_ChownRequest) msg.Owner = new(erpc.RoleId) - - chownunixUser, err := c.getUnixUser(chownUser) - if err != nil { - return err - } - - msg.Owner.Uid, err = strconv.ParseUint(chownunixUser.Uid, 10, 64) + msg.Owner.Uid, err = strconv.ParseUint(chownUID, 10, 64) if err != nil { return err } @@ -735,26 +647,26 @@ func (c *Client) Chown(ctx context.Context, username, chownUser, path string) er // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Error().Err(err).Str("username", username).Str("chownuser", chownUser).Str("path", path).Str("err", err.Error()) + log.Error().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' chownuser: '%s' path: '%s'", username, chownUser, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' chownuid: '%s' path: '%s'", uid, chownUID, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } // Chmod given path -func (c *Client) Chmod(ctx context.Context, username, mode, path string) error { +func (c *Client) Chmod(ctx context.Context, uid, gid, mode, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -775,26 +687,26 @@ func (c *Client) Chmod(ctx context.Context, username, mode, path string) error { // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("mode", mode).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("mode", mode).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' mode: '%s' path: '%s'", username, mode, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' mode: '%s' path: '%s'", uid, mode, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } // CreateDir creates a directory at the given path -func (c *Client) CreateDir(ctx context.Context, username, path string) error { +func (c *Client) CreateDir(ctx context.Context, uid, gid, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -816,25 +728,25 @@ func (c *Client) CreateDir(ctx context.Context, username, path string) error { // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' path: '%s'", uid, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } -func (c *Client) rm(ctx context.Context, username, path string) error { +func (c *Client) rm(ctx context.Context, uid, gid, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -849,76 +761,78 @@ func (c *Client) rm(ctx context.Context, username, path string) error { // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' path: '%s'", uid, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } -func (c *Client) rmdir(ctx context.Context, username, path string) error { +func (c *Client) rmdir(ctx context.Context, uid, gid, path string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } - msg := new(erpc.NSRequest_RmdirRequest) + msg := new(erpc.NSRequest_RmRequest) msg.Id = new(erpc.MDId) msg.Id.Path = []byte(path) + msg.Recursive = true + msg.Norecycle = false - rq.Command = &erpc.NSRequest_Rmdir{Rmdir: msg} + rq.Command = &erpc.NSRequest_Rm{Rm: msg} // Now send the req and see what happens resp, err := c.cl.Exec(ctx, rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' path: '%s'", username, path)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' path: '%s'", uid, path)) } - log.Info().Str("username", username).Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") + log.Info().Str("path", path).Str("resp:", fmt.Sprintf("%#v", resp)).Msg("grpc response") return err } // Remove removes the resource at the given path -func (c *Client) Remove(ctx context.Context, username, path string) error { +func (c *Client) Remove(ctx context.Context, uid, gid, path string) error { log := appctx.GetLogger(ctx) - nfo, err := c.GetFileInfoByPath(ctx, username, path) + nfo, err := c.GetFileInfoByPath(ctx, uid, gid, path) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", path).Str("err", err.Error()) + log.Warn().Err(err).Str("path", path).Str("err", err.Error()) return err } if nfo.IsDir { - return c.rmdir(ctx, username, path) + return c.rmdir(ctx, uid, gid, path) } - return c.rm(ctx, username, path) + return c.rm(ctx, uid, gid, path) } // Rename renames the resource referenced by oldPath to newPath -func (c *Client) Rename(ctx context.Context, username, oldPath, newPath string) error { - return errtypes.NotFound(fmt.Sprintf("%s:%s", "acltype", newPath)) +func (c *Client) Rename(ctx context.Context, uid, gid, oldPath, newPath string) error { + return errtypes.NotSupported("eosgrpc: Rename not implemented") } // List the contents of the directory given by path -func (c *Client) List(ctx context.Context, username, dpath string) ([]*FileInfo, error) { +func (c *Client) List(ctx context.Context, uid, gid, dpath string) ([]*eosclient.FileInfo, error) { log := appctx.GetLogger(ctx) // Stuff filename, uid, gid into the FindRequest type @@ -928,34 +842,30 @@ func (c *Client) List(ctx context.Context, username, dpath string) ([]*FileInfo, fdrq.Id = new(erpc.MDId) fdrq.Id.Path = []byte(dpath) - unixUser, err := c.getUnixUser(username) - if err != nil { - return nil, err - } fdrq.Role = new(erpc.RoleId) - uid, err := strconv.ParseUint(unixUser.Uid, 10, 64) + uidInt, err := strconv.ParseUint(uid, 10, 64) if err != nil { return nil, err } - fdrq.Role.Uid = uid - gid, err := strconv.ParseUint(unixUser.Gid, 10, 64) + gidInt, err := strconv.ParseUint(gid, 10, 64) if err != nil { return nil, err } - fdrq.Role.Gid = gid + fdrq.Role.Uid = uidInt + fdrq.Role.Gid = gidInt fdrq.Authkey = c.opt.Authkey // Now send the req and see what happens resp, err := c.cl.Find(context.Background(), fdrq) if err != nil { - log.Error().Err(err).Str("username", username).Str("path", dpath).Str("err", err.Error()) + log.Error().Err(err).Str("path", dpath).Str("err", err.Error()) return nil, err } - var mylst []*FileInfo + var mylst []*eosclient.FileInfo i := 0 for { rsp, err := resp.Recv() @@ -964,21 +874,21 @@ func (c *Client) List(ctx context.Context, username, dpath string) ([]*FileInfo, return mylst, nil } - log.Warn().Err(err).Str("username", username).Str("path", dpath).Str("err", err.Error()) + log.Warn().Err(err).Str("path", dpath).Str("err", err.Error()) return nil, err } if rsp == nil { - log.Warn().Err(err).Str("username", username).Str("path", dpath).Str("err", "rsp is nil") + log.Warn().Err(err).Str("path", dpath).Str("err", "rsp is nil") return nil, errtypes.NotFound(dpath) } - log.Debug().Str("username", username).Str("path", dpath).Str("item resp:", fmt.Sprintf("%#v", rsp)).Msg("grpc response") + log.Debug().Str("path", dpath).Str("item resp:", fmt.Sprintf("%#v", rsp)).Msg("grpc response") myitem, err := c.grpcMDResponseToFileInfo(rsp, dpath) if err != nil { - log.Warn().Err(err).Str("username", username).Str("path", dpath).Str("could not convert item:", fmt.Sprintf("%#v", rsp)).Str("err:", err.Error()).Msg("") + log.Warn().Err(err).Str("path", dpath).Str("could not convert item:", fmt.Sprintf("%#v", rsp)).Str("err:", err.Error()).Msg("") return nil, err } @@ -992,30 +902,21 @@ func (c *Client) List(ctx context.Context, username, dpath string) ([]*FileInfo, } // Read reads a file from the mgm -func (c *Client) Read(ctx context.Context, username, path string) (io.ReadCloser, error) { - unixUser, err := c.getUnixUser(username) - if err != nil { - return nil, err - } +func (c *Client) Read(ctx context.Context, uid, gid, path string) (io.ReadCloser, error) { rand := "eosread-" + uuid.Must(uuid.NewV4()).String() localTarget := fmt.Sprintf("%s/%s", c.opt.CacheDirectory, rand) defer os.RemoveAll(localTarget) xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) - cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", xrdPath, localTarget, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s", unixUser.Uid, unixUser.Gid)) - _, _, err = c.execute(ctx, cmd) - if err != nil { + cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", xrdPath, localTarget, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s", uid, gid)) + if _, _, err := c.execute(ctx, cmd); err != nil { return nil, err } return os.Open(localTarget) } // Write writes a file to the mgm -func (c *Client) Write(ctx context.Context, username, path string, stream io.ReadCloser) error { - unixUser, err := c.getUnixUser(username) - if err != nil { - return err - } +func (c *Client) Write(ctx context.Context, uid, gid, path string, stream io.ReadCloser) error { fd, err := ioutil.TempFile(c.opt.CacheDirectory, "eoswrite-") if err != nil { return err @@ -1028,18 +929,25 @@ func (c *Client) Write(ctx context.Context, username, path string, stream io.Rea if err != nil { return err } + + return c.WriteFile(ctx, uid, gid, path, fd.Name()) +} + +// WriteFile writes an existing file to the mgm +func (c *Client) WriteFile(ctx context.Context, uid, gid, path, source string) error { xrdPath := fmt.Sprintf("%s//%s", c.opt.URL, path) - cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", fd.Name(), xrdPath, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s", unixUser.Uid, unixUser.Gid)) - _, _, err = c.execute(ctx, cmd) + cmd := exec.CommandContext(ctx, c.opt.XrdcopyBinary, "--nopbar", "--silent", "-f", source, xrdPath, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s", uid, gid)) + _, _, err := c.execute(ctx, cmd) return err + } // ListDeletedEntries returns a list of the deleted entries. -func (c *Client) ListDeletedEntries(ctx context.Context, username string) ([]*DeletedEntry, error) { +func (c *Client) ListDeletedEntries(ctx context.Context, uid, gid string) ([]*eosclient.DeletedEntry, error) { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return nil, err } @@ -1052,29 +960,29 @@ func (c *Client) ListDeletedEntries(ctx context.Context, username string) ([]*De // Now send the req and see what happens resp, err := c.cl.Exec(context.Background(), rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("err", err.Error()) + log.Warn().Err(err).Str("err", err.Error()) return nil, err } if resp == nil { - return nil, errtypes.InternalError(fmt.Sprintf("nil response for username: '%s'", username)) + return nil, errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s'", uid)) } - log.Info().Str("username", username).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") // TODO(labkode): add protection if slave is configured and alive to count how many files are in the trashbin before // triggering the recycle ls call that could break the instance because of unavailable memory. // FF: I agree with labkode, if we think we may have memory problems then the semantics of the grpc call`and // the semantics if this func will have to change. For now this is not foreseen - ret := make([]*DeletedEntry, 0) + ret := make([]*eosclient.DeletedEntry, 0) for _, f := range resp.Recycle.Recycles { if f == nil { - log.Info().Str("username", username).Msg("nil item in response") + log.Info().Msg("nil item in response") continue } - entry := &DeletedEntry{ + entry := &eosclient.DeletedEntry{ RestorePath: string(f.Id.Path), RestoreKey: f.Key, Size: f.Size, @@ -1089,11 +997,11 @@ func (c *Client) ListDeletedEntries(ctx context.Context, username string) ([]*De } // RestoreDeletedEntry restores a deleted entry. -func (c *Client) RestoreDeletedEntry(ctx context.Context, username, key string) error { +func (c *Client) RestoreDeletedEntry(ctx context.Context, uid, gid, key string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -1108,25 +1016,25 @@ func (c *Client) RestoreDeletedEntry(ctx context.Context, username, key string) // Now send the req and see what happens resp, err := c.cl.Exec(context.Background(), rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("key", key).Str("err", err.Error()) + log.Warn().Err(err).Str("key", key).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' key: '%s'", username, key)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' key: '%s'", uid, key)) } - log.Info().Str("username", username).Str("key", key).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Str("key", key).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") return err } // PurgeDeletedEntries purges all entries from the recycle bin. -func (c *Client) PurgeDeletedEntries(ctx context.Context, username string) error { +func (c *Client) PurgeDeletedEntries(ctx context.Context, uid, gid string) error { log := appctx.GetLogger(ctx) // Initialize the common fields of the NSReq - rq, err := c.initNSRequest(username) + rq, err := c.initNSRequest(uid, gid) if err != nil { return err } @@ -1139,40 +1047,35 @@ func (c *Client) PurgeDeletedEntries(ctx context.Context, username string) error // Now send the req and see what happens resp, err := c.cl.Exec(context.Background(), rq) if err != nil { - log.Warn().Err(err).Str("username", username).Str("err", err.Error()) + log.Warn().Err(err).Str("err", err.Error()) return err } if resp == nil { - return errtypes.InternalError(fmt.Sprintf("nil response for username: '%s' ", username)) + return errtypes.InternalError(fmt.Sprintf("nil response for uid: '%s' ", uid)) } - log.Info().Str("username", username).Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") + log.Info().Int64("errcode", resp.GetError().Code).Str("errmsg", resp.GetError().Msg).Msg("grpc response") return err } // ListVersions list all the versions for a given file. -func (c *Client) ListVersions(ctx context.Context, username, p string) ([]*FileInfo, error) { - basename := path.Base(p) - versionFolder := path.Join(path.Dir(p), versionPrefix+basename) - finfos, err := c.List(ctx, username, versionFolder) +func (c *Client) ListVersions(ctx context.Context, uid, gid, p string) ([]*eosclient.FileInfo, error) { + versionFolder := getVersionFolder(p) + finfos, err := c.List(ctx, uid, gid, versionFolder) if err != nil { // we send back an empty list - return []*FileInfo{}, nil + return []*eosclient.FileInfo{}, nil } return finfos, nil } // RollbackToVersion rollbacks a file to a previous version. -func (c *Client) RollbackToVersion(ctx context.Context, username, path, version string) error { +func (c *Client) RollbackToVersion(ctx context.Context, uid, gid, path, version string) error { // TODO(ffurano): /* - unixUser, err := c.getUnixUser(username) - if err != nil { - return err - } - cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", unixUser.Uid, unixUser.Gid, "file", "versions", path, version) + cmd := exec.CommandContext(ctx, c.opt.EosBinary, "-r", uid, gid, "file", "versions", path, version) _, _, err = c.executeEOS(ctx, cmd) return err */ @@ -1180,17 +1083,52 @@ func (c *Client) RollbackToVersion(ctx context.Context, username, path, version } // ReadVersion reads the version for the given file. -func (c *Client) ReadVersion(ctx context.Context, username, p, version string) (io.ReadCloser, error) { - basename := path.Base(p) - versionFile := path.Join(path.Dir(p), versionPrefix+basename, version) - return c.Read(ctx, username, versionFile) +func (c *Client) ReadVersion(ctx context.Context, uid, gid, p, version string) (io.ReadCloser, error) { + versionFile := path.Join(getVersionFolder(p), version) + return c.Read(ctx, uid, gid, versionFile) +} + +func (c *Client) getVersionFolderInode(ctx context.Context, uid, gid, p string) (uint64, error) { + versionFolder := getVersionFolder(p) + md, err := c.GetFileInfoByPath(ctx, uid, gid, versionFolder) + if err != nil { + if err = c.CreateDir(ctx, uid, gid, versionFolder); err != nil { + return 0, err + } + md, err = c.GetFileInfoByPath(ctx, uid, gid, versionFolder) + if err != nil { + return 0, err + } + } + return md.Inode, nil } -func (c *Client) grpcMDResponseToFileInfo(st *erpc.MDResponse, namepfx string) (*FileInfo, error) { +func (c *Client) getFileInfoFromVersion(ctx context.Context, uid, gid, p string) (*eosclient.FileInfo, error) { + file := getFileFromVersionFolder(p) + md, err := c.GetFileInfoByPath(ctx, uid, gid, file) + if err != nil { + return nil, err + } + return md, nil +} + +func isVersionFolder(p string) bool { + return strings.HasPrefix(path.Base(p), versionPrefix) +} + +func getVersionFolder(p string) string { + return path.Join(path.Dir(p), versionPrefix+path.Base(p)) +} + +func getFileFromVersionFolder(p string) string { + return path.Join(path.Dir(p), strings.TrimPrefix(path.Base(p), versionPrefix)) +} + +func (c *Client) grpcMDResponseToFileInfo(st *erpc.MDResponse, namepfx string) (*eosclient.FileInfo, error) { if st.Cmd == nil && st.Fmd == nil { return nil, errors.Wrap(errtypes.NotSupported(""), "Invalid response (st.Cmd and st.Fmd are nil)") } - fi := new(FileInfo) + fi := new(eosclient.FileInfo) if st.Type != 0 { fi.IsDir = true @@ -1200,6 +1138,7 @@ func (c *Client) grpcMDResponseToFileInfo(st *erpc.MDResponse, namepfx string) ( fi.UID = st.Fmd.Uid fi.GID = st.Fmd.Gid fi.MTimeSec = st.Fmd.Mtime.Sec + fi.ETag = st.Fmd.Etag if namepfx == "" { fi.File = string(st.Fmd.Name) } else { @@ -1220,55 +1159,31 @@ func (c *Client) grpcMDResponseToFileInfo(st *erpc.MDResponse, namepfx string) ( fi.UID = st.Cmd.Uid fi.GID = st.Cmd.Gid fi.MTimeSec = st.Cmd.Mtime.Sec + fi.ETag = st.Cmd.Etag if namepfx == "" { fi.File = string(st.Cmd.Name) } else { fi.File = namepfx + "/" + string(st.Cmd.Name) } + var allattrs = "" for k, v := range st.Cmd.Xattrs { if fi.Attrs == nil { fi.Attrs = make(map[string]string) } fi.Attrs[k] = string(v) + allattrs += string(v) + allattrs += "," } fi.Size = 0 } - fi.ETag = fi.Attrs["etag"] + log.Debug().Str("stat info - path", fi.File).Uint64("inode:", fi.Inode).Uint64("uid:", fi.UID).Uint64("gid:", fi.GID).Str("etag:", fi.ETag).Msg("grpc response") return fi, nil } -// FileInfo represents the metadata information returned by querying the EOS namespace. -type FileInfo struct { - IsDir bool - MTimeNanos uint32 - Inode uint64 `json:"inode"` - FID uint64 `json:"fid"` - UID uint64 `json:"uid"` - GID uint64 `json:"gid"` - TreeSize uint64 `json:"tree_size"` - MTimeSec uint64 `json:"mtime_sec"` - Size uint64 `json:"size"` - TreeCount uint64 `json:"tree_count"` - File string `json:"eos_file"` - ETag string `json:"etag"` - Instance string `json:"instance"` - SysACL string `json:"sys_acl"` - Attrs map[string]string `json:"attrs"` -} - -// DeletedEntry represents an entry from the trashbin. -type DeletedEntry struct { - RestorePath string - RestoreKey string - Size uint64 - DeletionMTime uint64 - IsDir bool -} - // exec executes the command and returns the stdout, stderr and return code func (c *Client) execute(ctx context.Context, cmd *exec.Cmd) (string, string, error) { log := appctx.GetLogger(ctx) diff --git a/pkg/eosclientgrpc/eos_grpc/eos_grpc.pb.go b/pkg/eosclientgrpc/eos_grpc/eos_grpc.pb.go deleted file mode 100644 index 53c3b33c29..0000000000 --- a/pkg/eosclientgrpc/eos_grpc/eos_grpc.pb.go +++ /dev/null @@ -1,4560 +0,0 @@ -// Copyright 2018-2020 CERN -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// In applying this license, CERN does not waive the privileges and immunities -// granted to it by virtue of its status as an Intergovernmental Organization -// or submit itself to any jurisdiction. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// source: eos_grpc.proto - -package eos_grpc - -import ( - context "context" - fmt "fmt" - math "math" - - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package - -type TYPE int32 - -const ( - TYPE_FILE TYPE = 0 - TYPE_CONTAINER TYPE = 1 - TYPE_LISTING TYPE = 2 - TYPE_STAT TYPE = 3 -) - -var TYPE_name = map[int32]string{ - 0: "FILE", - 1: "CONTAINER", - 2: "LISTING", - 3: "STAT", -} - -var TYPE_value = map[string]int32{ - "FILE": 0, - "CONTAINER": 1, - "LISTING": 2, - "STAT": 3, -} - -func (x TYPE) String() string { - return proto.EnumName(TYPE_name, int32(x)) -} - -func (TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{0} -} - -type QUOTATYPE int32 - -const ( - QUOTATYPE_USER QUOTATYPE = 0 - QUOTATYPE_GROUP QUOTATYPE = 2 - QUOTATYPE_PROJECT QUOTATYPE = 3 - QUOTATYPE_ALL QUOTATYPE = 4 -) - -var QUOTATYPE_name = map[int32]string{ - 0: "USER", - 2: "GROUP", - 3: "PROJECT", - 4: "ALL", -} - -var QUOTATYPE_value = map[string]int32{ - "USER": 0, - "GROUP": 2, - "PROJECT": 3, - "ALL": 4, -} - -func (x QUOTATYPE) String() string { - return proto.EnumName(QUOTATYPE_name, int32(x)) -} - -func (QUOTATYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{1} -} - -type MANILA_REQUEST_TYPE int32 - -const ( - MANILA_REQUEST_TYPE_CREATE_SHARE MANILA_REQUEST_TYPE = 0 - MANILA_REQUEST_TYPE_DELETE_SHARE MANILA_REQUEST_TYPE = 1 - MANILA_REQUEST_TYPE_EXTEND_SHARE MANILA_REQUEST_TYPE = 2 - MANILA_REQUEST_TYPE_SHRINK_SHARE MANILA_REQUEST_TYPE = 3 - MANILA_REQUEST_TYPE_MANAGE_EXISTING MANILA_REQUEST_TYPE = 4 - MANILA_REQUEST_TYPE_UNMANAGE MANILA_REQUEST_TYPE = 5 - MANILA_REQUEST_TYPE_GET_CAPACITIES MANILA_REQUEST_TYPE = 6 -) - -var MANILA_REQUEST_TYPE_name = map[int32]string{ - 0: "CREATE_SHARE", - 1: "DELETE_SHARE", - 2: "EXTEND_SHARE", - 3: "SHRINK_SHARE", - 4: "MANAGE_EXISTING", - 5: "UNMANAGE", - 6: "GET_CAPACITIES", -} - -var MANILA_REQUEST_TYPE_value = map[string]int32{ - "CREATE_SHARE": 0, - "DELETE_SHARE": 1, - "EXTEND_SHARE": 2, - "SHRINK_SHARE": 3, - "MANAGE_EXISTING": 4, - "UNMANAGE": 5, - "GET_CAPACITIES": 6, -} - -func (x MANILA_REQUEST_TYPE) String() string { - return proto.EnumName(MANILA_REQUEST_TYPE_name, int32(x)) -} - -func (MANILA_REQUEST_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{2} -} - -type NSRequest_VersionRequest_VERSION_CMD int32 - -const ( - NSRequest_VersionRequest_CREATE NSRequest_VersionRequest_VERSION_CMD = 0 - NSRequest_VersionRequest_PURGE NSRequest_VersionRequest_VERSION_CMD = 1 - NSRequest_VersionRequest_LIST NSRequest_VersionRequest_VERSION_CMD = 2 -) - -var NSRequest_VersionRequest_VERSION_CMD_name = map[int32]string{ - 0: "CREATE", - 1: "PURGE", - 2: "LIST", -} - -var NSRequest_VersionRequest_VERSION_CMD_value = map[string]int32{ - "CREATE": 0, - "PURGE": 1, - "LIST": 2, -} - -func (x NSRequest_VersionRequest_VERSION_CMD) String() string { - return proto.EnumName(NSRequest_VersionRequest_VERSION_CMD_name, int32(x)) -} - -func (NSRequest_VersionRequest_VERSION_CMD) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 7, 0} -} - -type NSRequest_RecycleRequest_RECYCLE_CMD int32 - -const ( - NSRequest_RecycleRequest_RESTORE NSRequest_RecycleRequest_RECYCLE_CMD = 0 - NSRequest_RecycleRequest_PURGE NSRequest_RecycleRequest_RECYCLE_CMD = 1 - NSRequest_RecycleRequest_LIST NSRequest_RecycleRequest_RECYCLE_CMD = 2 -) - -var NSRequest_RecycleRequest_RECYCLE_CMD_name = map[int32]string{ - 0: "RESTORE", - 1: "PURGE", - 2: "LIST", -} - -var NSRequest_RecycleRequest_RECYCLE_CMD_value = map[string]int32{ - "RESTORE": 0, - "PURGE": 1, - "LIST": 2, -} - -func (x NSRequest_RecycleRequest_RECYCLE_CMD) String() string { - return proto.EnumName(NSRequest_RecycleRequest_RECYCLE_CMD_name, int32(x)) -} - -func (NSRequest_RecycleRequest_RECYCLE_CMD) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 8, 0} -} - -type NSRequest_AclRequest_ACL_COMMAND int32 - -const ( - NSRequest_AclRequest_NONE NSRequest_AclRequest_ACL_COMMAND = 0 - NSRequest_AclRequest_MODIFY NSRequest_AclRequest_ACL_COMMAND = 1 - NSRequest_AclRequest_LIST NSRequest_AclRequest_ACL_COMMAND = 2 -) - -var NSRequest_AclRequest_ACL_COMMAND_name = map[int32]string{ - 0: "NONE", - 1: "MODIFY", - 2: "LIST", -} - -var NSRequest_AclRequest_ACL_COMMAND_value = map[string]int32{ - "NONE": 0, - "MODIFY": 1, - "LIST": 2, -} - -func (x NSRequest_AclRequest_ACL_COMMAND) String() string { - return proto.EnumName(NSRequest_AclRequest_ACL_COMMAND_name, int32(x)) -} - -func (NSRequest_AclRequest_ACL_COMMAND) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 12, 0} -} - -type NSRequest_AclRequest_ACL_TYPE int32 - -const ( - NSRequest_AclRequest_USER_ACL NSRequest_AclRequest_ACL_TYPE = 0 - NSRequest_AclRequest_SYS_ACL NSRequest_AclRequest_ACL_TYPE = 1 -) - -var NSRequest_AclRequest_ACL_TYPE_name = map[int32]string{ - 0: "USER_ACL", - 1: "SYS_ACL", -} - -var NSRequest_AclRequest_ACL_TYPE_value = map[string]int32{ - "USER_ACL": 0, - "SYS_ACL": 1, -} - -func (x NSRequest_AclRequest_ACL_TYPE) String() string { - return proto.EnumName(NSRequest_AclRequest_ACL_TYPE_name, int32(x)) -} - -func (NSRequest_AclRequest_ACL_TYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 12, 1} -} - -type NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE int32 - -const ( - NSResponse_RecycleResponse_RecycleInfo_FILE NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE = 0 - NSResponse_RecycleResponse_RecycleInfo_TREE NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE = 1 -) - -var NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name = map[int32]string{ - 0: "FILE", - 1: "TREE", -} - -var NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_value = map[string]int32{ - "FILE": 0, - "TREE": 1, -} - -func (x NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE) String() string { - return proto.EnumName(NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name, int32(x)) -} - -func (NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 2, 0, 0} -} - -type PingRequest struct { - Authkey string `protobuf:"bytes,1,opt,name=authkey,proto3" json:"authkey,omitempty"` - Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PingRequest) Reset() { *m = PingRequest{} } -func (m *PingRequest) String() string { return proto.CompactTextString(m) } -func (*PingRequest) ProtoMessage() {} -func (*PingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{0} -} - -func (m *PingRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PingRequest.Unmarshal(m, b) -} -func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) -} -func (m *PingRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingRequest.Merge(m, src) -} -func (m *PingRequest) XXX_Size() int { - return xxx_messageInfo_PingRequest.Size(m) -} -func (m *PingRequest) XXX_DiscardUnknown() { - xxx_messageInfo_PingRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_PingRequest proto.InternalMessageInfo - -func (m *PingRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -func (m *PingRequest) GetMessage() []byte { - if m != nil { - return m.Message - } - return nil -} - -type PingReply struct { - Message []byte `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *PingReply) Reset() { *m = PingReply{} } -func (m *PingReply) String() string { return proto.CompactTextString(m) } -func (*PingReply) ProtoMessage() {} -func (*PingReply) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{1} -} - -func (m *PingReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_PingReply.Unmarshal(m, b) -} -func (m *PingReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_PingReply.Marshal(b, m, deterministic) -} -func (m *PingReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_PingReply.Merge(m, src) -} -func (m *PingReply) XXX_Size() int { - return xxx_messageInfo_PingReply.Size(m) -} -func (m *PingReply) XXX_DiscardUnknown() { - xxx_messageInfo_PingReply.DiscardUnknown(m) -} - -var xxx_messageInfo_PingReply proto.InternalMessageInfo - -func (m *PingReply) GetMessage() []byte { - if m != nil { - return m.Message - } - return nil -} - -type ContainerInsertRequest struct { - Container []*ContainerMdProto `protobuf:"bytes,1,rep,name=container,proto3" json:"container,omitempty"` - Authkey string `protobuf:"bytes,2,opt,name=authkey,proto3" json:"authkey,omitempty"` - InheritMd bool `protobuf:"varint,3,opt,name=inherit_md,json=inheritMd,proto3" json:"inherit_md,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContainerInsertRequest) Reset() { *m = ContainerInsertRequest{} } -func (m *ContainerInsertRequest) String() string { return proto.CompactTextString(m) } -func (*ContainerInsertRequest) ProtoMessage() {} -func (*ContainerInsertRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{2} -} - -func (m *ContainerInsertRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContainerInsertRequest.Unmarshal(m, b) -} -func (m *ContainerInsertRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContainerInsertRequest.Marshal(b, m, deterministic) -} -func (m *ContainerInsertRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerInsertRequest.Merge(m, src) -} -func (m *ContainerInsertRequest) XXX_Size() int { - return xxx_messageInfo_ContainerInsertRequest.Size(m) -} -func (m *ContainerInsertRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerInsertRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerInsertRequest proto.InternalMessageInfo - -func (m *ContainerInsertRequest) GetContainer() []*ContainerMdProto { - if m != nil { - return m.Container - } - return nil -} - -func (m *ContainerInsertRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -func (m *ContainerInsertRequest) GetInheritMd() bool { - if m != nil { - return m.InheritMd - } - return false -} - -type FileInsertRequest struct { - Files []*FileMdProto `protobuf:"bytes,1,rep,name=files,proto3" json:"files,omitempty"` - Authkey string `protobuf:"bytes,2,opt,name=authkey,proto3" json:"authkey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileInsertRequest) Reset() { *m = FileInsertRequest{} } -func (m *FileInsertRequest) String() string { return proto.CompactTextString(m) } -func (*FileInsertRequest) ProtoMessage() {} -func (*FileInsertRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{3} -} - -func (m *FileInsertRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileInsertRequest.Unmarshal(m, b) -} -func (m *FileInsertRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileInsertRequest.Marshal(b, m, deterministic) -} -func (m *FileInsertRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileInsertRequest.Merge(m, src) -} -func (m *FileInsertRequest) XXX_Size() int { - return xxx_messageInfo_FileInsertRequest.Size(m) -} -func (m *FileInsertRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FileInsertRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FileInsertRequest proto.InternalMessageInfo - -func (m *FileInsertRequest) GetFiles() []*FileMdProto { - if m != nil { - return m.Files - } - return nil -} - -func (m *FileInsertRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -type InsertReply struct { - Message []string `protobuf:"bytes,1,rep,name=message,proto3" json:"message,omitempty"` - Retc []uint32 `protobuf:"varint,2,rep,packed,name=retc,proto3" json:"retc,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *InsertReply) Reset() { *m = InsertReply{} } -func (m *InsertReply) String() string { return proto.CompactTextString(m) } -func (*InsertReply) ProtoMessage() {} -func (*InsertReply) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{4} -} - -func (m *InsertReply) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_InsertReply.Unmarshal(m, b) -} -func (m *InsertReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_InsertReply.Marshal(b, m, deterministic) -} -func (m *InsertReply) XXX_Merge(src proto.Message) { - xxx_messageInfo_InsertReply.Merge(m, src) -} -func (m *InsertReply) XXX_Size() int { - return xxx_messageInfo_InsertReply.Size(m) -} -func (m *InsertReply) XXX_DiscardUnknown() { - xxx_messageInfo_InsertReply.DiscardUnknown(m) -} - -var xxx_messageInfo_InsertReply proto.InternalMessageInfo - -func (m *InsertReply) GetMessage() []string { - if m != nil { - return m.Message - } - return nil -} - -func (m *InsertReply) GetRetc() []uint32 { - if m != nil { - return m.Retc - } - return nil -} - -type Time struct { - Sec uint64 `protobuf:"varint,1,opt,name=sec,proto3" json:"sec,omitempty"` - NSec uint64 `protobuf:"varint,2,opt,name=n_sec,json=nSec,proto3" json:"n_sec,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Time) Reset() { *m = Time{} } -func (m *Time) String() string { return proto.CompactTextString(m) } -func (*Time) ProtoMessage() {} -func (*Time) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{5} -} - -func (m *Time) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Time.Unmarshal(m, b) -} -func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Time.Marshal(b, m, deterministic) -} -func (m *Time) XXX_Merge(src proto.Message) { - xxx_messageInfo_Time.Merge(m, src) -} -func (m *Time) XXX_Size() int { - return xxx_messageInfo_Time.Size(m) -} -func (m *Time) XXX_DiscardUnknown() { - xxx_messageInfo_Time.DiscardUnknown(m) -} - -var xxx_messageInfo_Time proto.InternalMessageInfo - -func (m *Time) GetSec() uint64 { - if m != nil { - return m.Sec - } - return 0 -} - -func (m *Time) GetNSec() uint64 { - if m != nil { - return m.NSec - } - return 0 -} - -type Checksum struct { - Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"` - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Checksum) Reset() { *m = Checksum{} } -func (m *Checksum) String() string { return proto.CompactTextString(m) } -func (*Checksum) ProtoMessage() {} -func (*Checksum) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{6} -} - -func (m *Checksum) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Checksum.Unmarshal(m, b) -} -func (m *Checksum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Checksum.Marshal(b, m, deterministic) -} -func (m *Checksum) XXX_Merge(src proto.Message) { - xxx_messageInfo_Checksum.Merge(m, src) -} -func (m *Checksum) XXX_Size() int { - return xxx_messageInfo_Checksum.Size(m) -} -func (m *Checksum) XXX_DiscardUnknown() { - xxx_messageInfo_Checksum.DiscardUnknown(m) -} - -var xxx_messageInfo_Checksum proto.InternalMessageInfo - -func (m *Checksum) GetValue() []byte { - if m != nil { - return m.Value - } - return nil -} - -func (m *Checksum) GetType() string { - if m != nil { - return m.Type - } - return "" -} - -type FileMdProto struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ContId uint64 `protobuf:"varint,2,opt,name=cont_id,json=contId,proto3" json:"cont_id,omitempty"` - Uid uint64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint64 `protobuf:"varint,4,opt,name=gid,proto3" json:"gid,omitempty"` - Size uint64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"` - LayoutId uint32 `protobuf:"varint,6,opt,name=layout_id,json=layoutId,proto3" json:"layout_id,omitempty"` - Flags uint32 `protobuf:"varint,7,opt,name=flags,proto3" json:"flags,omitempty"` - Name []byte `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` - LinkName []byte `protobuf:"bytes,9,opt,name=link_name,json=linkName,proto3" json:"link_name,omitempty"` - Ctime *Time `protobuf:"bytes,10,opt,name=ctime,proto3" json:"ctime,omitempty"` - Mtime *Time `protobuf:"bytes,11,opt,name=mtime,proto3" json:"mtime,omitempty"` - Checksum *Checksum `protobuf:"bytes,12,opt,name=checksum,proto3" json:"checksum,omitempty"` - Locations []uint32 `protobuf:"varint,13,rep,packed,name=locations,proto3" json:"locations,omitempty"` - UnlinkLocations []uint32 `protobuf:"varint,14,rep,packed,name=unlink_locations,json=unlinkLocations,proto3" json:"unlink_locations,omitempty"` - Xattrs map[string][]byte `protobuf:"bytes,15,rep,name=xattrs,proto3" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Path []byte `protobuf:"bytes,16,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FileMdProto) Reset() { *m = FileMdProto{} } -func (m *FileMdProto) String() string { return proto.CompactTextString(m) } -func (*FileMdProto) ProtoMessage() {} -func (*FileMdProto) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{7} -} - -func (m *FileMdProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FileMdProto.Unmarshal(m, b) -} -func (m *FileMdProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FileMdProto.Marshal(b, m, deterministic) -} -func (m *FileMdProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_FileMdProto.Merge(m, src) -} -func (m *FileMdProto) XXX_Size() int { - return xxx_messageInfo_FileMdProto.Size(m) -} -func (m *FileMdProto) XXX_DiscardUnknown() { - xxx_messageInfo_FileMdProto.DiscardUnknown(m) -} - -var xxx_messageInfo_FileMdProto proto.InternalMessageInfo - -func (m *FileMdProto) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *FileMdProto) GetContId() uint64 { - if m != nil { - return m.ContId - } - return 0 -} - -func (m *FileMdProto) GetUid() uint64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *FileMdProto) GetGid() uint64 { - if m != nil { - return m.Gid - } - return 0 -} - -func (m *FileMdProto) GetSize() uint64 { - if m != nil { - return m.Size - } - return 0 -} - -func (m *FileMdProto) GetLayoutId() uint32 { - if m != nil { - return m.LayoutId - } - return 0 -} - -func (m *FileMdProto) GetFlags() uint32 { - if m != nil { - return m.Flags - } - return 0 -} - -func (m *FileMdProto) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *FileMdProto) GetLinkName() []byte { - if m != nil { - return m.LinkName - } - return nil -} - -func (m *FileMdProto) GetCtime() *Time { - if m != nil { - return m.Ctime - } - return nil -} - -func (m *FileMdProto) GetMtime() *Time { - if m != nil { - return m.Mtime - } - return nil -} - -func (m *FileMdProto) GetChecksum() *Checksum { - if m != nil { - return m.Checksum - } - return nil -} - -func (m *FileMdProto) GetLocations() []uint32 { - if m != nil { - return m.Locations - } - return nil -} - -func (m *FileMdProto) GetUnlinkLocations() []uint32 { - if m != nil { - return m.UnlinkLocations - } - return nil -} - -func (m *FileMdProto) GetXattrs() map[string][]byte { - if m != nil { - return m.Xattrs - } - return nil -} - -func (m *FileMdProto) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -type ContainerMdProto struct { - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - ParentId uint64 `protobuf:"varint,2,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` - Uid uint64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint64 `protobuf:"varint,4,opt,name=gid,proto3" json:"gid,omitempty"` - TreeSize int64 `protobuf:"varint,6,opt,name=tree_size,json=treeSize,proto3" json:"tree_size,omitempty"` - Mode uint32 `protobuf:"varint,5,opt,name=mode,proto3" json:"mode,omitempty"` - Flags uint32 `protobuf:"varint,7,opt,name=flags,proto3" json:"flags,omitempty"` - Name []byte `protobuf:"bytes,8,opt,name=name,proto3" json:"name,omitempty"` - Ctime *Time `protobuf:"bytes,9,opt,name=ctime,proto3" json:"ctime,omitempty"` - Mtime *Time `protobuf:"bytes,10,opt,name=mtime,proto3" json:"mtime,omitempty"` - Stime *Time `protobuf:"bytes,11,opt,name=stime,proto3" json:"stime,omitempty"` - Xattrs map[string][]byte `protobuf:"bytes,12,rep,name=xattrs,proto3" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Path []byte `protobuf:"bytes,13,opt,name=path,proto3" json:"path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ContainerMdProto) Reset() { *m = ContainerMdProto{} } -func (m *ContainerMdProto) String() string { return proto.CompactTextString(m) } -func (*ContainerMdProto) ProtoMessage() {} -func (*ContainerMdProto) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{8} -} - -func (m *ContainerMdProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ContainerMdProto.Unmarshal(m, b) -} -func (m *ContainerMdProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ContainerMdProto.Marshal(b, m, deterministic) -} -func (m *ContainerMdProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_ContainerMdProto.Merge(m, src) -} -func (m *ContainerMdProto) XXX_Size() int { - return xxx_messageInfo_ContainerMdProto.Size(m) -} -func (m *ContainerMdProto) XXX_DiscardUnknown() { - xxx_messageInfo_ContainerMdProto.DiscardUnknown(m) -} - -var xxx_messageInfo_ContainerMdProto proto.InternalMessageInfo - -func (m *ContainerMdProto) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *ContainerMdProto) GetParentId() uint64 { - if m != nil { - return m.ParentId - } - return 0 -} - -func (m *ContainerMdProto) GetUid() uint64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *ContainerMdProto) GetGid() uint64 { - if m != nil { - return m.Gid - } - return 0 -} - -func (m *ContainerMdProto) GetTreeSize() int64 { - if m != nil { - return m.TreeSize - } - return 0 -} - -func (m *ContainerMdProto) GetMode() uint32 { - if m != nil { - return m.Mode - } - return 0 -} - -func (m *ContainerMdProto) GetFlags() uint32 { - if m != nil { - return m.Flags - } - return 0 -} - -func (m *ContainerMdProto) GetName() []byte { - if m != nil { - return m.Name - } - return nil -} - -func (m *ContainerMdProto) GetCtime() *Time { - if m != nil { - return m.Ctime - } - return nil -} - -func (m *ContainerMdProto) GetMtime() *Time { - if m != nil { - return m.Mtime - } - return nil -} - -func (m *ContainerMdProto) GetStime() *Time { - if m != nil { - return m.Stime - } - return nil -} - -func (m *ContainerMdProto) GetXattrs() map[string][]byte { - if m != nil { - return m.Xattrs - } - return nil -} - -func (m *ContainerMdProto) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -type QuotaProto struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Type QUOTATYPE `protobuf:"varint,3,opt,name=type,proto3,enum=eos.rpc.QUOTATYPE" json:"type,omitempty"` - Usedbytes uint64 `protobuf:"varint,4,opt,name=usedbytes,proto3" json:"usedbytes,omitempty"` - Usedlogicalbytes uint64 `protobuf:"varint,5,opt,name=usedlogicalbytes,proto3" json:"usedlogicalbytes,omitempty"` - Usedfiles uint64 `protobuf:"varint,6,opt,name=usedfiles,proto3" json:"usedfiles,omitempty"` - Maxbytes uint64 `protobuf:"varint,7,opt,name=maxbytes,proto3" json:"maxbytes,omitempty"` - Maxlogicalbytes uint64 `protobuf:"varint,8,opt,name=maxlogicalbytes,proto3" json:"maxlogicalbytes,omitempty"` - Maxfiles uint64 `protobuf:"varint,9,opt,name=maxfiles,proto3" json:"maxfiles,omitempty"` - Percentageusedbytes float32 `protobuf:"fixed32,10,opt,name=percentageusedbytes,proto3" json:"percentageusedbytes,omitempty"` - Percentageusedfiles float32 `protobuf:"fixed32,11,opt,name=percentageusedfiles,proto3" json:"percentageusedfiles,omitempty"` - Statusbytes string `protobuf:"bytes,12,opt,name=statusbytes,proto3" json:"statusbytes,omitempty"` - Statusfiles string `protobuf:"bytes,13,opt,name=statusfiles,proto3" json:"statusfiles,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *QuotaProto) Reset() { *m = QuotaProto{} } -func (m *QuotaProto) String() string { return proto.CompactTextString(m) } -func (*QuotaProto) ProtoMessage() {} -func (*QuotaProto) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{9} -} - -func (m *QuotaProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_QuotaProto.Unmarshal(m, b) -} -func (m *QuotaProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_QuotaProto.Marshal(b, m, deterministic) -} -func (m *QuotaProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_QuotaProto.Merge(m, src) -} -func (m *QuotaProto) XXX_Size() int { - return xxx_messageInfo_QuotaProto.Size(m) -} -func (m *QuotaProto) XXX_DiscardUnknown() { - xxx_messageInfo_QuotaProto.DiscardUnknown(m) -} - -var xxx_messageInfo_QuotaProto proto.InternalMessageInfo - -func (m *QuotaProto) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *QuotaProto) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *QuotaProto) GetType() QUOTATYPE { - if m != nil { - return m.Type - } - return QUOTATYPE_USER -} - -func (m *QuotaProto) GetUsedbytes() uint64 { - if m != nil { - return m.Usedbytes - } - return 0 -} - -func (m *QuotaProto) GetUsedlogicalbytes() uint64 { - if m != nil { - return m.Usedlogicalbytes - } - return 0 -} - -func (m *QuotaProto) GetUsedfiles() uint64 { - if m != nil { - return m.Usedfiles - } - return 0 -} - -func (m *QuotaProto) GetMaxbytes() uint64 { - if m != nil { - return m.Maxbytes - } - return 0 -} - -func (m *QuotaProto) GetMaxlogicalbytes() uint64 { - if m != nil { - return m.Maxlogicalbytes - } - return 0 -} - -func (m *QuotaProto) GetMaxfiles() uint64 { - if m != nil { - return m.Maxfiles - } - return 0 -} - -func (m *QuotaProto) GetPercentageusedbytes() float32 { - if m != nil { - return m.Percentageusedbytes - } - return 0 -} - -func (m *QuotaProto) GetPercentageusedfiles() float32 { - if m != nil { - return m.Percentageusedfiles - } - return 0 -} - -func (m *QuotaProto) GetStatusbytes() string { - if m != nil { - return m.Statusbytes - } - return "" -} - -func (m *QuotaProto) GetStatusfiles() string { - if m != nil { - return m.Statusfiles - } - return "" -} - -type RoleId struct { - Uid uint64 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint64 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Groupname string `protobuf:"bytes,4,opt,name=groupname,proto3" json:"groupname,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *RoleId) Reset() { *m = RoleId{} } -func (m *RoleId) String() string { return proto.CompactTextString(m) } -func (*RoleId) ProtoMessage() {} -func (*RoleId) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{10} -} - -func (m *RoleId) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_RoleId.Unmarshal(m, b) -} -func (m *RoleId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_RoleId.Marshal(b, m, deterministic) -} -func (m *RoleId) XXX_Merge(src proto.Message) { - xxx_messageInfo_RoleId.Merge(m, src) -} -func (m *RoleId) XXX_Size() int { - return xxx_messageInfo_RoleId.Size(m) -} -func (m *RoleId) XXX_DiscardUnknown() { - xxx_messageInfo_RoleId.DiscardUnknown(m) -} - -var xxx_messageInfo_RoleId proto.InternalMessageInfo - -func (m *RoleId) GetUid() uint64 { - if m != nil { - return m.Uid - } - return 0 -} - -func (m *RoleId) GetGid() uint64 { - if m != nil { - return m.Gid - } - return 0 -} - -func (m *RoleId) GetUsername() string { - if m != nil { - return m.Username - } - return "" -} - -func (m *RoleId) GetGroupname() string { - if m != nil { - return m.Groupname - } - return "" -} - -type MDId struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Id uint64 `protobuf:"fixed64,2,opt,name=id,proto3" json:"id,omitempty"` - Ino uint64 `protobuf:"fixed64,3,opt,name=ino,proto3" json:"ino,omitempty"` - Type TYPE `protobuf:"varint,4,opt,name=type,proto3,enum=eos.rpc.TYPE" json:"type,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MDId) Reset() { *m = MDId{} } -func (m *MDId) String() string { return proto.CompactTextString(m) } -func (*MDId) ProtoMessage() {} -func (*MDId) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{11} -} - -func (m *MDId) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MDId.Unmarshal(m, b) -} -func (m *MDId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MDId.Marshal(b, m, deterministic) -} -func (m *MDId) XXX_Merge(src proto.Message) { - xxx_messageInfo_MDId.Merge(m, src) -} -func (m *MDId) XXX_Size() int { - return xxx_messageInfo_MDId.Size(m) -} -func (m *MDId) XXX_DiscardUnknown() { - xxx_messageInfo_MDId.DiscardUnknown(m) -} - -var xxx_messageInfo_MDId proto.InternalMessageInfo - -func (m *MDId) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *MDId) GetId() uint64 { - if m != nil { - return m.Id - } - return 0 -} - -func (m *MDId) GetIno() uint64 { - if m != nil { - return m.Ino - } - return 0 -} - -func (m *MDId) GetType() TYPE { - if m != nil { - return m.Type - } - return TYPE_FILE -} - -type Limit struct { - Zero bool `protobuf:"varint,1,opt,name=zero,proto3" json:"zero,omitempty"` - Min uint64 `protobuf:"varint,2,opt,name=min,proto3" json:"min,omitempty"` - Max uint64 `protobuf:"varint,3,opt,name=max,proto3" json:"max,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *Limit) Reset() { *m = Limit{} } -func (m *Limit) String() string { return proto.CompactTextString(m) } -func (*Limit) ProtoMessage() {} -func (*Limit) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{12} -} - -func (m *Limit) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_Limit.Unmarshal(m, b) -} -func (m *Limit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_Limit.Marshal(b, m, deterministic) -} -func (m *Limit) XXX_Merge(src proto.Message) { - xxx_messageInfo_Limit.Merge(m, src) -} -func (m *Limit) XXX_Size() int { - return xxx_messageInfo_Limit.Size(m) -} -func (m *Limit) XXX_DiscardUnknown() { - xxx_messageInfo_Limit.DiscardUnknown(m) -} - -var xxx_messageInfo_Limit proto.InternalMessageInfo - -func (m *Limit) GetZero() bool { - if m != nil { - return m.Zero - } - return false -} - -func (m *Limit) GetMin() uint64 { - if m != nil { - return m.Min - } - return 0 -} - -func (m *Limit) GetMax() uint64 { - if m != nil { - return m.Max - } - return 0 -} - -type MDSelection struct { - Select bool `protobuf:"varint,1,opt,name=select,proto3" json:"select,omitempty"` - Ctime *Limit `protobuf:"bytes,2,opt,name=ctime,proto3" json:"ctime,omitempty"` - Mtime *Limit `protobuf:"bytes,3,opt,name=mtime,proto3" json:"mtime,omitempty"` - Stime *Limit `protobuf:"bytes,4,opt,name=stime,proto3" json:"stime,omitempty"` - Size *Limit `protobuf:"bytes,5,opt,name=size,proto3" json:"size,omitempty"` - Treesize *Limit `protobuf:"bytes,6,opt,name=treesize,proto3" json:"treesize,omitempty"` - Children *Limit `protobuf:"bytes,7,opt,name=children,proto3" json:"children,omitempty"` - Locations *Limit `protobuf:"bytes,8,opt,name=locations,proto3" json:"locations,omitempty"` - UnlinkedLocations *Limit `protobuf:"bytes,9,opt,name=unlinked_locations,json=unlinkedLocations,proto3" json:"unlinked_locations,omitempty"` - Layoutid uint64 `protobuf:"varint,10,opt,name=layoutid,proto3" json:"layoutid,omitempty"` - Flags uint64 `protobuf:"varint,11,opt,name=flags,proto3" json:"flags,omitempty"` - Symlink bool `protobuf:"varint,12,opt,name=symlink,proto3" json:"symlink,omitempty"` - Checksum *Checksum `protobuf:"bytes,13,opt,name=checksum,proto3" json:"checksum,omitempty"` - Owner uint32 `protobuf:"varint,14,opt,name=owner,proto3" json:"owner,omitempty"` - Group uint32 `protobuf:"varint,15,opt,name=group,proto3" json:"group,omitempty"` - OwnerRoot bool `protobuf:"varint,16,opt,name=owner_root,json=ownerRoot,proto3" json:"owner_root,omitempty"` - GroupRoot bool `protobuf:"varint,17,opt,name=group_root,json=groupRoot,proto3" json:"group_root,omitempty"` - RegexpFilename []byte `protobuf:"bytes,18,opt,name=regexp_filename,json=regexpFilename,proto3" json:"regexp_filename,omitempty"` - RegexpDirname []byte `protobuf:"bytes,19,opt,name=regexp_dirname,json=regexpDirname,proto3" json:"regexp_dirname,omitempty"` - Xattr map[string][]byte `protobuf:"bytes,20,rep,name=xattr,proto3" json:"xattr,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MDSelection) Reset() { *m = MDSelection{} } -func (m *MDSelection) String() string { return proto.CompactTextString(m) } -func (*MDSelection) ProtoMessage() {} -func (*MDSelection) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{13} -} - -func (m *MDSelection) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MDSelection.Unmarshal(m, b) -} -func (m *MDSelection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MDSelection.Marshal(b, m, deterministic) -} -func (m *MDSelection) XXX_Merge(src proto.Message) { - xxx_messageInfo_MDSelection.Merge(m, src) -} -func (m *MDSelection) XXX_Size() int { - return xxx_messageInfo_MDSelection.Size(m) -} -func (m *MDSelection) XXX_DiscardUnknown() { - xxx_messageInfo_MDSelection.DiscardUnknown(m) -} - -var xxx_messageInfo_MDSelection proto.InternalMessageInfo - -func (m *MDSelection) GetSelect() bool { - if m != nil { - return m.Select - } - return false -} - -func (m *MDSelection) GetCtime() *Limit { - if m != nil { - return m.Ctime - } - return nil -} - -func (m *MDSelection) GetMtime() *Limit { - if m != nil { - return m.Mtime - } - return nil -} - -func (m *MDSelection) GetStime() *Limit { - if m != nil { - return m.Stime - } - return nil -} - -func (m *MDSelection) GetSize() *Limit { - if m != nil { - return m.Size - } - return nil -} - -func (m *MDSelection) GetTreesize() *Limit { - if m != nil { - return m.Treesize - } - return nil -} - -func (m *MDSelection) GetChildren() *Limit { - if m != nil { - return m.Children - } - return nil -} - -func (m *MDSelection) GetLocations() *Limit { - if m != nil { - return m.Locations - } - return nil -} - -func (m *MDSelection) GetUnlinkedLocations() *Limit { - if m != nil { - return m.UnlinkedLocations - } - return nil -} - -func (m *MDSelection) GetLayoutid() uint64 { - if m != nil { - return m.Layoutid - } - return 0 -} - -func (m *MDSelection) GetFlags() uint64 { - if m != nil { - return m.Flags - } - return 0 -} - -func (m *MDSelection) GetSymlink() bool { - if m != nil { - return m.Symlink - } - return false -} - -func (m *MDSelection) GetChecksum() *Checksum { - if m != nil { - return m.Checksum - } - return nil -} - -func (m *MDSelection) GetOwner() uint32 { - if m != nil { - return m.Owner - } - return 0 -} - -func (m *MDSelection) GetGroup() uint32 { - if m != nil { - return m.Group - } - return 0 -} - -func (m *MDSelection) GetOwnerRoot() bool { - if m != nil { - return m.OwnerRoot - } - return false -} - -func (m *MDSelection) GetGroupRoot() bool { - if m != nil { - return m.GroupRoot - } - return false -} - -func (m *MDSelection) GetRegexpFilename() []byte { - if m != nil { - return m.RegexpFilename - } - return nil -} - -func (m *MDSelection) GetRegexpDirname() []byte { - if m != nil { - return m.RegexpDirname - } - return nil -} - -func (m *MDSelection) GetXattr() map[string][]byte { - if m != nil { - return m.Xattr - } - return nil -} - -type MDRequest struct { - Type TYPE `protobuf:"varint,1,opt,name=type,proto3,enum=eos.rpc.TYPE" json:"type,omitempty"` - Id *MDId `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Authkey string `protobuf:"bytes,3,opt,name=authkey,proto3" json:"authkey,omitempty"` - Role *RoleId `protobuf:"bytes,4,opt,name=role,proto3" json:"role,omitempty"` - Selection *MDSelection `protobuf:"bytes,5,opt,name=selection,proto3" json:"selection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MDRequest) Reset() { *m = MDRequest{} } -func (m *MDRequest) String() string { return proto.CompactTextString(m) } -func (*MDRequest) ProtoMessage() {} -func (*MDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{14} -} - -func (m *MDRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MDRequest.Unmarshal(m, b) -} -func (m *MDRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MDRequest.Marshal(b, m, deterministic) -} -func (m *MDRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_MDRequest.Merge(m, src) -} -func (m *MDRequest) XXX_Size() int { - return xxx_messageInfo_MDRequest.Size(m) -} -func (m *MDRequest) XXX_DiscardUnknown() { - xxx_messageInfo_MDRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_MDRequest proto.InternalMessageInfo - -func (m *MDRequest) GetType() TYPE { - if m != nil { - return m.Type - } - return TYPE_FILE -} - -func (m *MDRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *MDRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -func (m *MDRequest) GetRole() *RoleId { - if m != nil { - return m.Role - } - return nil -} - -func (m *MDRequest) GetSelection() *MDSelection { - if m != nil { - return m.Selection - } - return nil -} - -type MDResponse struct { - Type TYPE `protobuf:"varint,1,opt,name=type,proto3,enum=eos.rpc.TYPE" json:"type,omitempty"` - Fmd *FileMdProto `protobuf:"bytes,2,opt,name=fmd,proto3" json:"fmd,omitempty"` - Cmd *ContainerMdProto `protobuf:"bytes,3,opt,name=cmd,proto3" json:"cmd,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MDResponse) Reset() { *m = MDResponse{} } -func (m *MDResponse) String() string { return proto.CompactTextString(m) } -func (*MDResponse) ProtoMessage() {} -func (*MDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{15} -} - -func (m *MDResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MDResponse.Unmarshal(m, b) -} -func (m *MDResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MDResponse.Marshal(b, m, deterministic) -} -func (m *MDResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MDResponse.Merge(m, src) -} -func (m *MDResponse) XXX_Size() int { - return xxx_messageInfo_MDResponse.Size(m) -} -func (m *MDResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MDResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MDResponse proto.InternalMessageInfo - -func (m *MDResponse) GetType() TYPE { - if m != nil { - return m.Type - } - return TYPE_FILE -} - -func (m *MDResponse) GetFmd() *FileMdProto { - if m != nil { - return m.Fmd - } - return nil -} - -func (m *MDResponse) GetCmd() *ContainerMdProto { - if m != nil { - return m.Cmd - } - return nil -} - -type FindRequest struct { - Type TYPE `protobuf:"varint,1,opt,name=type,proto3,enum=eos.rpc.TYPE" json:"type,omitempty"` - Id *MDId `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - Role *RoleId `protobuf:"bytes,3,opt,name=role,proto3" json:"role,omitempty"` - Authkey string `protobuf:"bytes,4,opt,name=authkey,proto3" json:"authkey,omitempty"` - Maxdepth uint64 `protobuf:"varint,5,opt,name=maxdepth,proto3" json:"maxdepth,omitempty"` - Selection *MDSelection `protobuf:"bytes,6,opt,name=selection,proto3" json:"selection,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *FindRequest) Reset() { *m = FindRequest{} } -func (m *FindRequest) String() string { return proto.CompactTextString(m) } -func (*FindRequest) ProtoMessage() {} -func (*FindRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{16} -} - -func (m *FindRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_FindRequest.Unmarshal(m, b) -} -func (m *FindRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_FindRequest.Marshal(b, m, deterministic) -} -func (m *FindRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindRequest.Merge(m, src) -} -func (m *FindRequest) XXX_Size() int { - return xxx_messageInfo_FindRequest.Size(m) -} -func (m *FindRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FindRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FindRequest proto.InternalMessageInfo - -func (m *FindRequest) GetType() TYPE { - if m != nil { - return m.Type - } - return TYPE_FILE -} - -func (m *FindRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *FindRequest) GetRole() *RoleId { - if m != nil { - return m.Role - } - return nil -} - -func (m *FindRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -func (m *FindRequest) GetMaxdepth() uint64 { - if m != nil { - return m.Maxdepth - } - return 0 -} - -func (m *FindRequest) GetSelection() *MDSelection { - if m != nil { - return m.Selection - } - return nil -} - -type ShareAuth struct { - Prot string `protobuf:"bytes,1,opt,name=prot,proto3" json:"prot,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Host string `protobuf:"bytes,3,opt,name=host,proto3" json:"host,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ShareAuth) Reset() { *m = ShareAuth{} } -func (m *ShareAuth) String() string { return proto.CompactTextString(m) } -func (*ShareAuth) ProtoMessage() {} -func (*ShareAuth) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{17} -} - -func (m *ShareAuth) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ShareAuth.Unmarshal(m, b) -} -func (m *ShareAuth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ShareAuth.Marshal(b, m, deterministic) -} -func (m *ShareAuth) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShareAuth.Merge(m, src) -} -func (m *ShareAuth) XXX_Size() int { - return xxx_messageInfo_ShareAuth.Size(m) -} -func (m *ShareAuth) XXX_DiscardUnknown() { - xxx_messageInfo_ShareAuth.DiscardUnknown(m) -} - -var xxx_messageInfo_ShareAuth proto.InternalMessageInfo - -func (m *ShareAuth) GetProt() string { - if m != nil { - return m.Prot - } - return "" -} - -func (m *ShareAuth) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *ShareAuth) GetHost() string { - if m != nil { - return m.Host - } - return "" -} - -type ShareProto struct { - Permission string `protobuf:"bytes,1,opt,name=permission,proto3" json:"permission,omitempty"` - Expires uint64 `protobuf:"varint,2,opt,name=expires,proto3" json:"expires,omitempty"` - Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` - Group string `protobuf:"bytes,4,opt,name=group,proto3" json:"group,omitempty"` - Generation uint64 `protobuf:"varint,5,opt,name=generation,proto3" json:"generation,omitempty"` - Path string `protobuf:"bytes,6,opt,name=path,proto3" json:"path,omitempty"` - Allowtree bool `protobuf:"varint,7,opt,name=allowtree,proto3" json:"allowtree,omitempty"` - Vtoken string `protobuf:"bytes,8,opt,name=vtoken,proto3" json:"vtoken,omitempty"` - Origins []*ShareAuth `protobuf:"bytes,9,rep,name=origins,proto3" json:"origins,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ShareProto) Reset() { *m = ShareProto{} } -func (m *ShareProto) String() string { return proto.CompactTextString(m) } -func (*ShareProto) ProtoMessage() {} -func (*ShareProto) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{18} -} - -func (m *ShareProto) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ShareProto.Unmarshal(m, b) -} -func (m *ShareProto) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ShareProto.Marshal(b, m, deterministic) -} -func (m *ShareProto) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShareProto.Merge(m, src) -} -func (m *ShareProto) XXX_Size() int { - return xxx_messageInfo_ShareProto.Size(m) -} -func (m *ShareProto) XXX_DiscardUnknown() { - xxx_messageInfo_ShareProto.DiscardUnknown(m) -} - -var xxx_messageInfo_ShareProto proto.InternalMessageInfo - -func (m *ShareProto) GetPermission() string { - if m != nil { - return m.Permission - } - return "" -} - -func (m *ShareProto) GetExpires() uint64 { - if m != nil { - return m.Expires - } - return 0 -} - -func (m *ShareProto) GetOwner() string { - if m != nil { - return m.Owner - } - return "" -} - -func (m *ShareProto) GetGroup() string { - if m != nil { - return m.Group - } - return "" -} - -func (m *ShareProto) GetGeneration() uint64 { - if m != nil { - return m.Generation - } - return 0 -} - -func (m *ShareProto) GetPath() string { - if m != nil { - return m.Path - } - return "" -} - -func (m *ShareProto) GetAllowtree() bool { - if m != nil { - return m.Allowtree - } - return false -} - -func (m *ShareProto) GetVtoken() string { - if m != nil { - return m.Vtoken - } - return "" -} - -func (m *ShareProto) GetOrigins() []*ShareAuth { - if m != nil { - return m.Origins - } - return nil -} - -type ShareToken struct { - Token *ShareProto `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` - Serialized []byte `protobuf:"bytes,3,opt,name=serialized,proto3" json:"serialized,omitempty"` - Seed int32 `protobuf:"varint,4,opt,name=seed,proto3" json:"seed,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ShareToken) Reset() { *m = ShareToken{} } -func (m *ShareToken) String() string { return proto.CompactTextString(m) } -func (*ShareToken) ProtoMessage() {} -func (*ShareToken) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{19} -} - -func (m *ShareToken) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ShareToken.Unmarshal(m, b) -} -func (m *ShareToken) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ShareToken.Marshal(b, m, deterministic) -} -func (m *ShareToken) XXX_Merge(src proto.Message) { - xxx_messageInfo_ShareToken.Merge(m, src) -} -func (m *ShareToken) XXX_Size() int { - return xxx_messageInfo_ShareToken.Size(m) -} -func (m *ShareToken) XXX_DiscardUnknown() { - xxx_messageInfo_ShareToken.DiscardUnknown(m) -} - -var xxx_messageInfo_ShareToken proto.InternalMessageInfo - -func (m *ShareToken) GetToken() *ShareProto { - if m != nil { - return m.Token - } - return nil -} - -func (m *ShareToken) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -func (m *ShareToken) GetSerialized() []byte { - if m != nil { - return m.Serialized - } - return nil -} - -func (m *ShareToken) GetSeed() int32 { - if m != nil { - return m.Seed - } - return 0 -} - -type NSRequest struct { - Authkey string `protobuf:"bytes,1,opt,name=authkey,proto3" json:"authkey,omitempty"` - Role *RoleId `protobuf:"bytes,2,opt,name=role,proto3" json:"role,omitempty"` - // Actual request data object - // - // Types that are valid to be assigned to Command: - // *NSRequest_Mkdir - // *NSRequest_Rmdir - // *NSRequest_Touch - // *NSRequest_Unlink - // *NSRequest_Rm - // *NSRequest_Rename - // *NSRequest_Symlink - // *NSRequest_Version - // *NSRequest_Recycle - // *NSRequest_Xattr - // *NSRequest_Chown - // *NSRequest_Chmod - // *NSRequest_Acl - // *NSRequest_Token - // *NSRequest_Quota - Command isNSRequest_Command `protobuf_oneof:"command"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest) Reset() { *m = NSRequest{} } -func (m *NSRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest) ProtoMessage() {} -func (*NSRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20} -} - -func (m *NSRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest.Unmarshal(m, b) -} -func (m *NSRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest.Merge(m, src) -} -func (m *NSRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest.Size(m) -} -func (m *NSRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest proto.InternalMessageInfo - -func (m *NSRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -func (m *NSRequest) GetRole() *RoleId { - if m != nil { - return m.Role - } - return nil -} - -type isNSRequest_Command interface { - isNSRequest_Command() -} - -type NSRequest_Mkdir struct { - Mkdir *NSRequest_MkdirRequest `protobuf:"bytes,21,opt,name=mkdir,proto3,oneof"` -} - -type NSRequest_Rmdir struct { - Rmdir *NSRequest_RmdirRequest `protobuf:"bytes,22,opt,name=rmdir,proto3,oneof"` -} - -type NSRequest_Touch struct { - Touch *NSRequest_TouchRequest `protobuf:"bytes,23,opt,name=touch,proto3,oneof"` -} - -type NSRequest_Unlink struct { - Unlink *NSRequest_UnlinkRequest `protobuf:"bytes,24,opt,name=unlink,proto3,oneof"` -} - -type NSRequest_Rm struct { - Rm *NSRequest_RmRequest `protobuf:"bytes,25,opt,name=rm,proto3,oneof"` -} - -type NSRequest_Rename struct { - Rename *NSRequest_RenameRequest `protobuf:"bytes,26,opt,name=rename,proto3,oneof"` -} - -type NSRequest_Symlink struct { - Symlink *NSRequest_SymlinkRequest `protobuf:"bytes,27,opt,name=symlink,proto3,oneof"` -} - -type NSRequest_Version struct { - Version *NSRequest_VersionRequest `protobuf:"bytes,28,opt,name=version,proto3,oneof"` -} - -type NSRequest_Recycle struct { - Recycle *NSRequest_RecycleRequest `protobuf:"bytes,29,opt,name=recycle,proto3,oneof"` -} - -type NSRequest_Xattr struct { - Xattr *NSRequest_SetXAttrRequest `protobuf:"bytes,30,opt,name=xattr,proto3,oneof"` -} - -type NSRequest_Chown struct { - Chown *NSRequest_ChownRequest `protobuf:"bytes,31,opt,name=chown,proto3,oneof"` -} - -type NSRequest_Chmod struct { - Chmod *NSRequest_ChmodRequest `protobuf:"bytes,32,opt,name=chmod,proto3,oneof"` -} - -type NSRequest_Acl struct { - Acl *NSRequest_AclRequest `protobuf:"bytes,33,opt,name=acl,proto3,oneof"` -} - -type NSRequest_Token struct { - Token *NSRequest_TokenRequest `protobuf:"bytes,34,opt,name=token,proto3,oneof"` -} - -type NSRequest_Quota struct { - Quota *NSRequest_QuotaRequest `protobuf:"bytes,35,opt,name=quota,proto3,oneof"` -} - -func (*NSRequest_Mkdir) isNSRequest_Command() {} - -func (*NSRequest_Rmdir) isNSRequest_Command() {} - -func (*NSRequest_Touch) isNSRequest_Command() {} - -func (*NSRequest_Unlink) isNSRequest_Command() {} - -func (*NSRequest_Rm) isNSRequest_Command() {} - -func (*NSRequest_Rename) isNSRequest_Command() {} - -func (*NSRequest_Symlink) isNSRequest_Command() {} - -func (*NSRequest_Version) isNSRequest_Command() {} - -func (*NSRequest_Recycle) isNSRequest_Command() {} - -func (*NSRequest_Xattr) isNSRequest_Command() {} - -func (*NSRequest_Chown) isNSRequest_Command() {} - -func (*NSRequest_Chmod) isNSRequest_Command() {} - -func (*NSRequest_Acl) isNSRequest_Command() {} - -func (*NSRequest_Token) isNSRequest_Command() {} - -func (*NSRequest_Quota) isNSRequest_Command() {} - -func (m *NSRequest) GetCommand() isNSRequest_Command { - if m != nil { - return m.Command - } - return nil -} - -func (m *NSRequest) GetMkdir() *NSRequest_MkdirRequest { - if x, ok := m.GetCommand().(*NSRequest_Mkdir); ok { - return x.Mkdir - } - return nil -} - -func (m *NSRequest) GetRmdir() *NSRequest_RmdirRequest { - if x, ok := m.GetCommand().(*NSRequest_Rmdir); ok { - return x.Rmdir - } - return nil -} - -func (m *NSRequest) GetTouch() *NSRequest_TouchRequest { - if x, ok := m.GetCommand().(*NSRequest_Touch); ok { - return x.Touch - } - return nil -} - -func (m *NSRequest) GetUnlink() *NSRequest_UnlinkRequest { - if x, ok := m.GetCommand().(*NSRequest_Unlink); ok { - return x.Unlink - } - return nil -} - -func (m *NSRequest) GetRm() *NSRequest_RmRequest { - if x, ok := m.GetCommand().(*NSRequest_Rm); ok { - return x.Rm - } - return nil -} - -func (m *NSRequest) GetRename() *NSRequest_RenameRequest { - if x, ok := m.GetCommand().(*NSRequest_Rename); ok { - return x.Rename - } - return nil -} - -func (m *NSRequest) GetSymlink() *NSRequest_SymlinkRequest { - if x, ok := m.GetCommand().(*NSRequest_Symlink); ok { - return x.Symlink - } - return nil -} - -func (m *NSRequest) GetVersion() *NSRequest_VersionRequest { - if x, ok := m.GetCommand().(*NSRequest_Version); ok { - return x.Version - } - return nil -} - -func (m *NSRequest) GetRecycle() *NSRequest_RecycleRequest { - if x, ok := m.GetCommand().(*NSRequest_Recycle); ok { - return x.Recycle - } - return nil -} - -func (m *NSRequest) GetXattr() *NSRequest_SetXAttrRequest { - if x, ok := m.GetCommand().(*NSRequest_Xattr); ok { - return x.Xattr - } - return nil -} - -func (m *NSRequest) GetChown() *NSRequest_ChownRequest { - if x, ok := m.GetCommand().(*NSRequest_Chown); ok { - return x.Chown - } - return nil -} - -func (m *NSRequest) GetChmod() *NSRequest_ChmodRequest { - if x, ok := m.GetCommand().(*NSRequest_Chmod); ok { - return x.Chmod - } - return nil -} - -func (m *NSRequest) GetAcl() *NSRequest_AclRequest { - if x, ok := m.GetCommand().(*NSRequest_Acl); ok { - return x.Acl - } - return nil -} - -func (m *NSRequest) GetToken() *NSRequest_TokenRequest { - if x, ok := m.GetCommand().(*NSRequest_Token); ok { - return x.Token - } - return nil -} - -func (m *NSRequest) GetQuota() *NSRequest_QuotaRequest { - if x, ok := m.GetCommand().(*NSRequest_Quota); ok { - return x.Quota - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*NSRequest) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*NSRequest_Mkdir)(nil), - (*NSRequest_Rmdir)(nil), - (*NSRequest_Touch)(nil), - (*NSRequest_Unlink)(nil), - (*NSRequest_Rm)(nil), - (*NSRequest_Rename)(nil), - (*NSRequest_Symlink)(nil), - (*NSRequest_Version)(nil), - (*NSRequest_Recycle)(nil), - (*NSRequest_Xattr)(nil), - (*NSRequest_Chown)(nil), - (*NSRequest_Chmod)(nil), - (*NSRequest_Acl)(nil), - (*NSRequest_Token)(nil), - (*NSRequest_Quota)(nil), - } -} - -type NSRequest_MkdirRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Recursive bool `protobuf:"varint,2,opt,name=recursive,proto3" json:"recursive,omitempty"` - Mode int64 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_MkdirRequest) Reset() { *m = NSRequest_MkdirRequest{} } -func (m *NSRequest_MkdirRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_MkdirRequest) ProtoMessage() {} -func (*NSRequest_MkdirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 0} -} - -func (m *NSRequest_MkdirRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_MkdirRequest.Unmarshal(m, b) -} -func (m *NSRequest_MkdirRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_MkdirRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_MkdirRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_MkdirRequest.Merge(m, src) -} -func (m *NSRequest_MkdirRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_MkdirRequest.Size(m) -} -func (m *NSRequest_MkdirRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_MkdirRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_MkdirRequest proto.InternalMessageInfo - -func (m *NSRequest_MkdirRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_MkdirRequest) GetRecursive() bool { - if m != nil { - return m.Recursive - } - return false -} - -func (m *NSRequest_MkdirRequest) GetMode() int64 { - if m != nil { - return m.Mode - } - return 0 -} - -type NSRequest_RmdirRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RmdirRequest) Reset() { *m = NSRequest_RmdirRequest{} } -func (m *NSRequest_RmdirRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RmdirRequest) ProtoMessage() {} -func (*NSRequest_RmdirRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 1} -} - -func (m *NSRequest_RmdirRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RmdirRequest.Unmarshal(m, b) -} -func (m *NSRequest_RmdirRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RmdirRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_RmdirRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RmdirRequest.Merge(m, src) -} -func (m *NSRequest_RmdirRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_RmdirRequest.Size(m) -} -func (m *NSRequest_RmdirRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RmdirRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RmdirRequest proto.InternalMessageInfo - -func (m *NSRequest_RmdirRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -type NSRequest_TouchRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_TouchRequest) Reset() { *m = NSRequest_TouchRequest{} } -func (m *NSRequest_TouchRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_TouchRequest) ProtoMessage() {} -func (*NSRequest_TouchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 2} -} - -func (m *NSRequest_TouchRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_TouchRequest.Unmarshal(m, b) -} -func (m *NSRequest_TouchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_TouchRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_TouchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_TouchRequest.Merge(m, src) -} -func (m *NSRequest_TouchRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_TouchRequest.Size(m) -} -func (m *NSRequest_TouchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_TouchRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_TouchRequest proto.InternalMessageInfo - -func (m *NSRequest_TouchRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -type NSRequest_UnlinkRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Norecycle bool `protobuf:"varint,3,opt,name=norecycle,proto3" json:"norecycle,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_UnlinkRequest) Reset() { *m = NSRequest_UnlinkRequest{} } -func (m *NSRequest_UnlinkRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_UnlinkRequest) ProtoMessage() {} -func (*NSRequest_UnlinkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 3} -} - -func (m *NSRequest_UnlinkRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_UnlinkRequest.Unmarshal(m, b) -} -func (m *NSRequest_UnlinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_UnlinkRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_UnlinkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_UnlinkRequest.Merge(m, src) -} -func (m *NSRequest_UnlinkRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_UnlinkRequest.Size(m) -} -func (m *NSRequest_UnlinkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_UnlinkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_UnlinkRequest proto.InternalMessageInfo - -func (m *NSRequest_UnlinkRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_UnlinkRequest) GetNorecycle() bool { - if m != nil { - return m.Norecycle - } - return false -} - -type NSRequest_RmRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Recursive bool `protobuf:"varint,2,opt,name=recursive,proto3" json:"recursive,omitempty"` - Norecycle bool `protobuf:"varint,3,opt,name=norecycle,proto3" json:"norecycle,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RmRequest) Reset() { *m = NSRequest_RmRequest{} } -func (m *NSRequest_RmRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RmRequest) ProtoMessage() {} -func (*NSRequest_RmRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 4} -} - -func (m *NSRequest_RmRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RmRequest.Unmarshal(m, b) -} -func (m *NSRequest_RmRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RmRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_RmRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RmRequest.Merge(m, src) -} -func (m *NSRequest_RmRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_RmRequest.Size(m) -} -func (m *NSRequest_RmRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RmRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RmRequest proto.InternalMessageInfo - -func (m *NSRequest_RmRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_RmRequest) GetRecursive() bool { - if m != nil { - return m.Recursive - } - return false -} - -func (m *NSRequest_RmRequest) GetNorecycle() bool { - if m != nil { - return m.Norecycle - } - return false -} - -type NSRequest_RenameRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Target []byte `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RenameRequest) Reset() { *m = NSRequest_RenameRequest{} } -func (m *NSRequest_RenameRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RenameRequest) ProtoMessage() {} -func (*NSRequest_RenameRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 5} -} - -func (m *NSRequest_RenameRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RenameRequest.Unmarshal(m, b) -} -func (m *NSRequest_RenameRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RenameRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_RenameRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RenameRequest.Merge(m, src) -} -func (m *NSRequest_RenameRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_RenameRequest.Size(m) -} -func (m *NSRequest_RenameRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RenameRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RenameRequest proto.InternalMessageInfo - -func (m *NSRequest_RenameRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_RenameRequest) GetTarget() []byte { - if m != nil { - return m.Target - } - return nil -} - -type NSRequest_SymlinkRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Target []byte `protobuf:"bytes,2,opt,name=target,proto3" json:"target,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_SymlinkRequest) Reset() { *m = NSRequest_SymlinkRequest{} } -func (m *NSRequest_SymlinkRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_SymlinkRequest) ProtoMessage() {} -func (*NSRequest_SymlinkRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 6} -} - -func (m *NSRequest_SymlinkRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_SymlinkRequest.Unmarshal(m, b) -} -func (m *NSRequest_SymlinkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_SymlinkRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_SymlinkRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_SymlinkRequest.Merge(m, src) -} -func (m *NSRequest_SymlinkRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_SymlinkRequest.Size(m) -} -func (m *NSRequest_SymlinkRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_SymlinkRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_SymlinkRequest proto.InternalMessageInfo - -func (m *NSRequest_SymlinkRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_SymlinkRequest) GetTarget() []byte { - if m != nil { - return m.Target - } - return nil -} - -type NSRequest_VersionRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Cmd NSRequest_VersionRequest_VERSION_CMD `protobuf:"varint,2,opt,name=cmd,proto3,enum=eos.rpc.NSRequest_VersionRequest_VERSION_CMD" json:"cmd,omitempty"` - Maxversion int32 `protobuf:"varint,3,opt,name=maxversion,proto3" json:"maxversion,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_VersionRequest) Reset() { *m = NSRequest_VersionRequest{} } -func (m *NSRequest_VersionRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_VersionRequest) ProtoMessage() {} -func (*NSRequest_VersionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 7} -} - -func (m *NSRequest_VersionRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_VersionRequest.Unmarshal(m, b) -} -func (m *NSRequest_VersionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_VersionRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_VersionRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_VersionRequest.Merge(m, src) -} -func (m *NSRequest_VersionRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_VersionRequest.Size(m) -} -func (m *NSRequest_VersionRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_VersionRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_VersionRequest proto.InternalMessageInfo - -func (m *NSRequest_VersionRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_VersionRequest) GetCmd() NSRequest_VersionRequest_VERSION_CMD { - if m != nil { - return m.Cmd - } - return NSRequest_VersionRequest_CREATE -} - -func (m *NSRequest_VersionRequest) GetMaxversion() int32 { - if m != nil { - return m.Maxversion - } - return 0 -} - -type NSRequest_RecycleRequest struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Cmd NSRequest_RecycleRequest_RECYCLE_CMD `protobuf:"varint,2,opt,name=cmd,proto3,enum=eos.rpc.NSRequest_RecycleRequest_RECYCLE_CMD" json:"cmd,omitempty"` - Restoreflag *NSRequest_RecycleRequest_RestoreFlags `protobuf:"bytes,3,opt,name=restoreflag,proto3" json:"restoreflag,omitempty"` - Purgedate *NSRequest_RecycleRequest_PurgeDate `protobuf:"bytes,4,opt,name=purgedate,proto3" json:"purgedate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RecycleRequest) Reset() { *m = NSRequest_RecycleRequest{} } -func (m *NSRequest_RecycleRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RecycleRequest) ProtoMessage() {} -func (*NSRequest_RecycleRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 8} -} - -func (m *NSRequest_RecycleRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RecycleRequest.Unmarshal(m, b) -} -func (m *NSRequest_RecycleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RecycleRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_RecycleRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RecycleRequest.Merge(m, src) -} -func (m *NSRequest_RecycleRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_RecycleRequest.Size(m) -} -func (m *NSRequest_RecycleRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RecycleRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RecycleRequest proto.InternalMessageInfo - -func (m *NSRequest_RecycleRequest) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *NSRequest_RecycleRequest) GetCmd() NSRequest_RecycleRequest_RECYCLE_CMD { - if m != nil { - return m.Cmd - } - return NSRequest_RecycleRequest_RESTORE -} - -func (m *NSRequest_RecycleRequest) GetRestoreflag() *NSRequest_RecycleRequest_RestoreFlags { - if m != nil { - return m.Restoreflag - } - return nil -} - -func (m *NSRequest_RecycleRequest) GetPurgedate() *NSRequest_RecycleRequest_PurgeDate { - if m != nil { - return m.Purgedate - } - return nil -} - -type NSRequest_RecycleRequest_RestoreFlags struct { - Force bool `protobuf:"varint,1,opt,name=force,proto3" json:"force,omitempty"` - Mkpath bool `protobuf:"varint,2,opt,name=mkpath,proto3" json:"mkpath,omitempty"` - Versions bool `protobuf:"varint,3,opt,name=versions,proto3" json:"versions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RecycleRequest_RestoreFlags) Reset() { *m = NSRequest_RecycleRequest_RestoreFlags{} } -func (m *NSRequest_RecycleRequest_RestoreFlags) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RecycleRequest_RestoreFlags) ProtoMessage() {} -func (*NSRequest_RecycleRequest_RestoreFlags) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 8, 0} -} - -func (m *NSRequest_RecycleRequest_RestoreFlags) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags.Unmarshal(m, b) -} -func (m *NSRequest_RecycleRequest_RestoreFlags) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags.Marshal(b, m, deterministic) -} -func (m *NSRequest_RecycleRequest_RestoreFlags) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags.Merge(m, src) -} -func (m *NSRequest_RecycleRequest_RestoreFlags) XXX_Size() int { - return xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags.Size(m) -} -func (m *NSRequest_RecycleRequest_RestoreFlags) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RecycleRequest_RestoreFlags proto.InternalMessageInfo - -func (m *NSRequest_RecycleRequest_RestoreFlags) GetForce() bool { - if m != nil { - return m.Force - } - return false -} - -func (m *NSRequest_RecycleRequest_RestoreFlags) GetMkpath() bool { - if m != nil { - return m.Mkpath - } - return false -} - -func (m *NSRequest_RecycleRequest_RestoreFlags) GetVersions() bool { - if m != nil { - return m.Versions - } - return false -} - -type NSRequest_RecycleRequest_PurgeDate struct { - Year int32 `protobuf:"varint,1,opt,name=year,proto3" json:"year,omitempty"` - Month int32 `protobuf:"varint,2,opt,name=month,proto3" json:"month,omitempty"` - Day int32 `protobuf:"varint,3,opt,name=day,proto3" json:"day,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_RecycleRequest_PurgeDate) Reset() { *m = NSRequest_RecycleRequest_PurgeDate{} } -func (m *NSRequest_RecycleRequest_PurgeDate) String() string { return proto.CompactTextString(m) } -func (*NSRequest_RecycleRequest_PurgeDate) ProtoMessage() {} -func (*NSRequest_RecycleRequest_PurgeDate) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 8, 1} -} - -func (m *NSRequest_RecycleRequest_PurgeDate) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate.Unmarshal(m, b) -} -func (m *NSRequest_RecycleRequest_PurgeDate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate.Marshal(b, m, deterministic) -} -func (m *NSRequest_RecycleRequest_PurgeDate) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate.Merge(m, src) -} -func (m *NSRequest_RecycleRequest_PurgeDate) XXX_Size() int { - return xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate.Size(m) -} -func (m *NSRequest_RecycleRequest_PurgeDate) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_RecycleRequest_PurgeDate proto.InternalMessageInfo - -func (m *NSRequest_RecycleRequest_PurgeDate) GetYear() int32 { - if m != nil { - return m.Year - } - return 0 -} - -func (m *NSRequest_RecycleRequest_PurgeDate) GetMonth() int32 { - if m != nil { - return m.Month - } - return 0 -} - -func (m *NSRequest_RecycleRequest_PurgeDate) GetDay() int32 { - if m != nil { - return m.Day - } - return 0 -} - -type NSRequest_SetXAttrRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Xattrs map[string][]byte `protobuf:"bytes,2,rep,name=xattrs,proto3" json:"xattrs,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Recursive bool `protobuf:"varint,3,opt,name=recursive,proto3" json:"recursive,omitempty"` - Keystodelete []string `protobuf:"bytes,4,rep,name=keystodelete,proto3" json:"keystodelete,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_SetXAttrRequest) Reset() { *m = NSRequest_SetXAttrRequest{} } -func (m *NSRequest_SetXAttrRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_SetXAttrRequest) ProtoMessage() {} -func (*NSRequest_SetXAttrRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 9} -} - -func (m *NSRequest_SetXAttrRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_SetXAttrRequest.Unmarshal(m, b) -} -func (m *NSRequest_SetXAttrRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_SetXAttrRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_SetXAttrRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_SetXAttrRequest.Merge(m, src) -} -func (m *NSRequest_SetXAttrRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_SetXAttrRequest.Size(m) -} -func (m *NSRequest_SetXAttrRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_SetXAttrRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_SetXAttrRequest proto.InternalMessageInfo - -func (m *NSRequest_SetXAttrRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_SetXAttrRequest) GetXattrs() map[string][]byte { - if m != nil { - return m.Xattrs - } - return nil -} - -func (m *NSRequest_SetXAttrRequest) GetRecursive() bool { - if m != nil { - return m.Recursive - } - return false -} - -func (m *NSRequest_SetXAttrRequest) GetKeystodelete() []string { - if m != nil { - return m.Keystodelete - } - return nil -} - -type NSRequest_ChownRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Owner *RoleId `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_ChownRequest) Reset() { *m = NSRequest_ChownRequest{} } -func (m *NSRequest_ChownRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_ChownRequest) ProtoMessage() {} -func (*NSRequest_ChownRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 10} -} - -func (m *NSRequest_ChownRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_ChownRequest.Unmarshal(m, b) -} -func (m *NSRequest_ChownRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_ChownRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_ChownRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_ChownRequest.Merge(m, src) -} -func (m *NSRequest_ChownRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_ChownRequest.Size(m) -} -func (m *NSRequest_ChownRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_ChownRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_ChownRequest proto.InternalMessageInfo - -func (m *NSRequest_ChownRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_ChownRequest) GetOwner() *RoleId { - if m != nil { - return m.Owner - } - return nil -} - -type NSRequest_ChmodRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Mode int64 `protobuf:"varint,2,opt,name=mode,proto3" json:"mode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_ChmodRequest) Reset() { *m = NSRequest_ChmodRequest{} } -func (m *NSRequest_ChmodRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_ChmodRequest) ProtoMessage() {} -func (*NSRequest_ChmodRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 11} -} - -func (m *NSRequest_ChmodRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_ChmodRequest.Unmarshal(m, b) -} -func (m *NSRequest_ChmodRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_ChmodRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_ChmodRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_ChmodRequest.Merge(m, src) -} -func (m *NSRequest_ChmodRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_ChmodRequest.Size(m) -} -func (m *NSRequest_ChmodRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_ChmodRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_ChmodRequest proto.InternalMessageInfo - -func (m *NSRequest_ChmodRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_ChmodRequest) GetMode() int64 { - if m != nil { - return m.Mode - } - return 0 -} - -type NSRequest_AclRequest struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Cmd NSRequest_AclRequest_ACL_COMMAND `protobuf:"varint,2,opt,name=cmd,proto3,enum=eos.rpc.NSRequest_AclRequest_ACL_COMMAND" json:"cmd,omitempty"` - Recursive bool `protobuf:"varint,3,opt,name=recursive,proto3" json:"recursive,omitempty"` - Type NSRequest_AclRequest_ACL_TYPE `protobuf:"varint,4,opt,name=type,proto3,enum=eos.rpc.NSRequest_AclRequest_ACL_TYPE" json:"type,omitempty"` - Rule string `protobuf:"bytes,5,opt,name=rule,proto3" json:"rule,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_AclRequest) Reset() { *m = NSRequest_AclRequest{} } -func (m *NSRequest_AclRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_AclRequest) ProtoMessage() {} -func (*NSRequest_AclRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 12} -} - -func (m *NSRequest_AclRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_AclRequest.Unmarshal(m, b) -} -func (m *NSRequest_AclRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_AclRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_AclRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_AclRequest.Merge(m, src) -} -func (m *NSRequest_AclRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_AclRequest.Size(m) -} -func (m *NSRequest_AclRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_AclRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_AclRequest proto.InternalMessageInfo - -func (m *NSRequest_AclRequest) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSRequest_AclRequest) GetCmd() NSRequest_AclRequest_ACL_COMMAND { - if m != nil { - return m.Cmd - } - return NSRequest_AclRequest_NONE -} - -func (m *NSRequest_AclRequest) GetRecursive() bool { - if m != nil { - return m.Recursive - } - return false -} - -func (m *NSRequest_AclRequest) GetType() NSRequest_AclRequest_ACL_TYPE { - if m != nil { - return m.Type - } - return NSRequest_AclRequest_USER_ACL -} - -func (m *NSRequest_AclRequest) GetRule() string { - if m != nil { - return m.Rule - } - return "" -} - -type NSRequest_TokenRequest struct { - Token *ShareToken `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_TokenRequest) Reset() { *m = NSRequest_TokenRequest{} } -func (m *NSRequest_TokenRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_TokenRequest) ProtoMessage() {} -func (*NSRequest_TokenRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 13} -} - -func (m *NSRequest_TokenRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_TokenRequest.Unmarshal(m, b) -} -func (m *NSRequest_TokenRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_TokenRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_TokenRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_TokenRequest.Merge(m, src) -} -func (m *NSRequest_TokenRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_TokenRequest.Size(m) -} -func (m *NSRequest_TokenRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_TokenRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_TokenRequest proto.InternalMessageInfo - -func (m *NSRequest_TokenRequest) GetToken() *ShareToken { - if m != nil { - return m.Token - } - return nil -} - -type NSRequest_QuotaRequest struct { - Path []byte `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` - Id *RoleId `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSRequest_QuotaRequest) Reset() { *m = NSRequest_QuotaRequest{} } -func (m *NSRequest_QuotaRequest) String() string { return proto.CompactTextString(m) } -func (*NSRequest_QuotaRequest) ProtoMessage() {} -func (*NSRequest_QuotaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{20, 14} -} - -func (m *NSRequest_QuotaRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSRequest_QuotaRequest.Unmarshal(m, b) -} -func (m *NSRequest_QuotaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSRequest_QuotaRequest.Marshal(b, m, deterministic) -} -func (m *NSRequest_QuotaRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSRequest_QuotaRequest.Merge(m, src) -} -func (m *NSRequest_QuotaRequest) XXX_Size() int { - return xxx_messageInfo_NSRequest_QuotaRequest.Size(m) -} -func (m *NSRequest_QuotaRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NSRequest_QuotaRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NSRequest_QuotaRequest proto.InternalMessageInfo - -func (m *NSRequest_QuotaRequest) GetPath() []byte { - if m != nil { - return m.Path - } - return nil -} - -func (m *NSRequest_QuotaRequest) GetId() *RoleId { - if m != nil { - return m.Id - } - return nil -} - -type NSResponse struct { - Error *NSResponse_ErrorResponse `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"` - Version *NSResponse_VersionResponse `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` - Recycle *NSResponse_RecycleResponse `protobuf:"bytes,3,opt,name=recycle,proto3" json:"recycle,omitempty"` - Acl *NSResponse_AclResponse `protobuf:"bytes,4,opt,name=acl,proto3" json:"acl,omitempty"` - Quota *NSResponse_QuotaResponse `protobuf:"bytes,5,opt,name=quota,proto3" json:"quota,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse) Reset() { *m = NSResponse{} } -func (m *NSResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse) ProtoMessage() {} -func (*NSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21} -} - -func (m *NSResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse.Unmarshal(m, b) -} -func (m *NSResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse.Merge(m, src) -} -func (m *NSResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse.Size(m) -} -func (m *NSResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse proto.InternalMessageInfo - -func (m *NSResponse) GetError() *NSResponse_ErrorResponse { - if m != nil { - return m.Error - } - return nil -} - -func (m *NSResponse) GetVersion() *NSResponse_VersionResponse { - if m != nil { - return m.Version - } - return nil -} - -func (m *NSResponse) GetRecycle() *NSResponse_RecycleResponse { - if m != nil { - return m.Recycle - } - return nil -} - -func (m *NSResponse) GetAcl() *NSResponse_AclResponse { - if m != nil { - return m.Acl - } - return nil -} - -func (m *NSResponse) GetQuota() *NSResponse_QuotaResponse { - if m != nil { - return m.Quota - } - return nil -} - -type NSResponse_ErrorResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_ErrorResponse) Reset() { *m = NSResponse_ErrorResponse{} } -func (m *NSResponse_ErrorResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse_ErrorResponse) ProtoMessage() {} -func (*NSResponse_ErrorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 0} -} - -func (m *NSResponse_ErrorResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_ErrorResponse.Unmarshal(m, b) -} -func (m *NSResponse_ErrorResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_ErrorResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse_ErrorResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_ErrorResponse.Merge(m, src) -} -func (m *NSResponse_ErrorResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse_ErrorResponse.Size(m) -} -func (m *NSResponse_ErrorResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_ErrorResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_ErrorResponse proto.InternalMessageInfo - -func (m *NSResponse_ErrorResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NSResponse_ErrorResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -type NSResponse_VersionResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Versions []*NSResponse_VersionResponse_VersionInfo `protobuf:"bytes,3,rep,name=versions,proto3" json:"versions,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_VersionResponse) Reset() { *m = NSResponse_VersionResponse{} } -func (m *NSResponse_VersionResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse_VersionResponse) ProtoMessage() {} -func (*NSResponse_VersionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 1} -} - -func (m *NSResponse_VersionResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_VersionResponse.Unmarshal(m, b) -} -func (m *NSResponse_VersionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_VersionResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse_VersionResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_VersionResponse.Merge(m, src) -} -func (m *NSResponse_VersionResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse_VersionResponse.Size(m) -} -func (m *NSResponse_VersionResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_VersionResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_VersionResponse proto.InternalMessageInfo - -func (m *NSResponse_VersionResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NSResponse_VersionResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func (m *NSResponse_VersionResponse) GetVersions() []*NSResponse_VersionResponse_VersionInfo { - if m != nil { - return m.Versions - } - return nil -} - -type NSResponse_VersionResponse_VersionInfo struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Mtime *Time `protobuf:"bytes,2,opt,name=mtime,proto3" json:"mtime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_VersionResponse_VersionInfo) Reset() { - *m = NSResponse_VersionResponse_VersionInfo{} -} -func (m *NSResponse_VersionResponse_VersionInfo) String() string { return proto.CompactTextString(m) } -func (*NSResponse_VersionResponse_VersionInfo) ProtoMessage() {} -func (*NSResponse_VersionResponse_VersionInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 1, 0} -} - -func (m *NSResponse_VersionResponse_VersionInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_VersionResponse_VersionInfo.Unmarshal(m, b) -} -func (m *NSResponse_VersionResponse_VersionInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_VersionResponse_VersionInfo.Marshal(b, m, deterministic) -} -func (m *NSResponse_VersionResponse_VersionInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_VersionResponse_VersionInfo.Merge(m, src) -} -func (m *NSResponse_VersionResponse_VersionInfo) XXX_Size() int { - return xxx_messageInfo_NSResponse_VersionResponse_VersionInfo.Size(m) -} -func (m *NSResponse_VersionResponse_VersionInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_VersionResponse_VersionInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_VersionResponse_VersionInfo proto.InternalMessageInfo - -func (m *NSResponse_VersionResponse_VersionInfo) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSResponse_VersionResponse_VersionInfo) GetMtime() *Time { - if m != nil { - return m.Mtime - } - return nil -} - -type NSResponse_RecycleResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Recycles []*NSResponse_RecycleResponse_RecycleInfo `protobuf:"bytes,3,rep,name=recycles,proto3" json:"recycles,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_RecycleResponse) Reset() { *m = NSResponse_RecycleResponse{} } -func (m *NSResponse_RecycleResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse_RecycleResponse) ProtoMessage() {} -func (*NSResponse_RecycleResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 2} -} - -func (m *NSResponse_RecycleResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_RecycleResponse.Unmarshal(m, b) -} -func (m *NSResponse_RecycleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_RecycleResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse_RecycleResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_RecycleResponse.Merge(m, src) -} -func (m *NSResponse_RecycleResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse_RecycleResponse.Size(m) -} -func (m *NSResponse_RecycleResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_RecycleResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_RecycleResponse proto.InternalMessageInfo - -func (m *NSResponse_RecycleResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NSResponse_RecycleResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func (m *NSResponse_RecycleResponse) GetRecycles() []*NSResponse_RecycleResponse_RecycleInfo { - if m != nil { - return m.Recycles - } - return nil -} - -type NSResponse_RecycleResponse_RecycleInfo struct { - Id *MDId `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Owner *RoleId `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` - Dtime *Time `protobuf:"bytes,3,opt,name=dtime,proto3" json:"dtime,omitempty"` - Size uint64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` - Type NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE `protobuf:"varint,5,opt,name=type,proto3,enum=eos.rpc.NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE" json:"type,omitempty"` - Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) Reset() { - *m = NSResponse_RecycleResponse_RecycleInfo{} -} -func (m *NSResponse_RecycleResponse_RecycleInfo) String() string { return proto.CompactTextString(m) } -func (*NSResponse_RecycleResponse_RecycleInfo) ProtoMessage() {} -func (*NSResponse_RecycleResponse_RecycleInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 2, 0} -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo.Unmarshal(m, b) -} -func (m *NSResponse_RecycleResponse_RecycleInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo.Marshal(b, m, deterministic) -} -func (m *NSResponse_RecycleResponse_RecycleInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo.Merge(m, src) -} -func (m *NSResponse_RecycleResponse_RecycleInfo) XXX_Size() int { - return xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo.Size(m) -} -func (m *NSResponse_RecycleResponse_RecycleInfo) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_RecycleResponse_RecycleInfo proto.InternalMessageInfo - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetId() *MDId { - if m != nil { - return m.Id - } - return nil -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetOwner() *RoleId { - if m != nil { - return m.Owner - } - return nil -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetDtime() *Time { - if m != nil { - return m.Dtime - } - return nil -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetSize() uint64 { - if m != nil { - return m.Size - } - return 0 -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetType() NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE { - if m != nil { - return m.Type - } - return NSResponse_RecycleResponse_RecycleInfo_FILE -} - -func (m *NSResponse_RecycleResponse_RecycleInfo) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -type NSResponse_AclResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Rule string `protobuf:"bytes,3,opt,name=rule,proto3" json:"rule,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_AclResponse) Reset() { *m = NSResponse_AclResponse{} } -func (m *NSResponse_AclResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse_AclResponse) ProtoMessage() {} -func (*NSResponse_AclResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 3} -} - -func (m *NSResponse_AclResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_AclResponse.Unmarshal(m, b) -} -func (m *NSResponse_AclResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_AclResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse_AclResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_AclResponse.Merge(m, src) -} -func (m *NSResponse_AclResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse_AclResponse.Size(m) -} -func (m *NSResponse_AclResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_AclResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_AclResponse proto.InternalMessageInfo - -func (m *NSResponse_AclResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NSResponse_AclResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func (m *NSResponse_AclResponse) GetRule() string { - if m != nil { - return m.Rule - } - return "" -} - -type NSResponse_QuotaResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` - Quotanode []*QuotaProto `protobuf:"bytes,3,rep,name=quotanode,proto3" json:"quotanode,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NSResponse_QuotaResponse) Reset() { *m = NSResponse_QuotaResponse{} } -func (m *NSResponse_QuotaResponse) String() string { return proto.CompactTextString(m) } -func (*NSResponse_QuotaResponse) ProtoMessage() {} -func (*NSResponse_QuotaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{21, 4} -} - -func (m *NSResponse_QuotaResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NSResponse_QuotaResponse.Unmarshal(m, b) -} -func (m *NSResponse_QuotaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NSResponse_QuotaResponse.Marshal(b, m, deterministic) -} -func (m *NSResponse_QuotaResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NSResponse_QuotaResponse.Merge(m, src) -} -func (m *NSResponse_QuotaResponse) XXX_Size() int { - return xxx_messageInfo_NSResponse_QuotaResponse.Size(m) -} -func (m *NSResponse_QuotaResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NSResponse_QuotaResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NSResponse_QuotaResponse proto.InternalMessageInfo - -func (m *NSResponse_QuotaResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NSResponse_QuotaResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func (m *NSResponse_QuotaResponse) GetQuotanode() []*QuotaProto { - if m != nil { - return m.Quotanode - } - return nil -} - -type NsStatRequest struct { - Authkey string `protobuf:"bytes,1,opt,name=authkey,proto3" json:"authkey,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NsStatRequest) Reset() { *m = NsStatRequest{} } -func (m *NsStatRequest) String() string { return proto.CompactTextString(m) } -func (*NsStatRequest) ProtoMessage() {} -func (*NsStatRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{22} -} - -func (m *NsStatRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NsStatRequest.Unmarshal(m, b) -} -func (m *NsStatRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NsStatRequest.Marshal(b, m, deterministic) -} -func (m *NsStatRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_NsStatRequest.Merge(m, src) -} -func (m *NsStatRequest) XXX_Size() int { - return xxx_messageInfo_NsStatRequest.Size(m) -} -func (m *NsStatRequest) XXX_DiscardUnknown() { - xxx_messageInfo_NsStatRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_NsStatRequest proto.InternalMessageInfo - -func (m *NsStatRequest) GetAuthkey() string { - if m != nil { - return m.Authkey - } - return "" -} - -type NsStatResponse struct { - Code int64 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` - Emsg string `protobuf:"bytes,2,opt,name=emsg,proto3" json:"emsg,omitempty"` - State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` - Nfiles uint64 `protobuf:"varint,4,opt,name=nfiles,proto3" json:"nfiles,omitempty"` - Ncontainers uint64 `protobuf:"varint,5,opt,name=ncontainers,proto3" json:"ncontainers,omitempty"` - BootTime uint64 `protobuf:"varint,6,opt,name=boot_time,json=bootTime,proto3" json:"boot_time,omitempty"` - CurrentFid uint64 `protobuf:"varint,7,opt,name=current_fid,json=currentFid,proto3" json:"current_fid,omitempty"` - CurrentCid uint64 `protobuf:"varint,8,opt,name=current_cid,json=currentCid,proto3" json:"current_cid,omitempty"` - MemVirtual uint64 `protobuf:"varint,9,opt,name=mem_virtual,json=memVirtual,proto3" json:"mem_virtual,omitempty"` - MemResident uint64 `protobuf:"varint,10,opt,name=mem_resident,json=memResident,proto3" json:"mem_resident,omitempty"` - MemShare uint64 `protobuf:"varint,11,opt,name=mem_share,json=memShare,proto3" json:"mem_share,omitempty"` - MemGrowth uint64 `protobuf:"varint,12,opt,name=mem_growth,json=memGrowth,proto3" json:"mem_growth,omitempty"` - Threads uint64 `protobuf:"varint,13,opt,name=threads,proto3" json:"threads,omitempty"` - Fds uint64 `protobuf:"varint,14,opt,name=fds,proto3" json:"fds,omitempty"` - Uptime uint64 `protobuf:"varint,15,opt,name=uptime,proto3" json:"uptime,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *NsStatResponse) Reset() { *m = NsStatResponse{} } -func (m *NsStatResponse) String() string { return proto.CompactTextString(m) } -func (*NsStatResponse) ProtoMessage() {} -func (*NsStatResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{23} -} - -func (m *NsStatResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_NsStatResponse.Unmarshal(m, b) -} -func (m *NsStatResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_NsStatResponse.Marshal(b, m, deterministic) -} -func (m *NsStatResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_NsStatResponse.Merge(m, src) -} -func (m *NsStatResponse) XXX_Size() int { - return xxx_messageInfo_NsStatResponse.Size(m) -} -func (m *NsStatResponse) XXX_DiscardUnknown() { - xxx_messageInfo_NsStatResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_NsStatResponse proto.InternalMessageInfo - -func (m *NsStatResponse) GetCode() int64 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *NsStatResponse) GetEmsg() string { - if m != nil { - return m.Emsg - } - return "" -} - -func (m *NsStatResponse) GetState() string { - if m != nil { - return m.State - } - return "" -} - -func (m *NsStatResponse) GetNfiles() uint64 { - if m != nil { - return m.Nfiles - } - return 0 -} - -func (m *NsStatResponse) GetNcontainers() uint64 { - if m != nil { - return m.Ncontainers - } - return 0 -} - -func (m *NsStatResponse) GetBootTime() uint64 { - if m != nil { - return m.BootTime - } - return 0 -} - -func (m *NsStatResponse) GetCurrentFid() uint64 { - if m != nil { - return m.CurrentFid - } - return 0 -} - -func (m *NsStatResponse) GetCurrentCid() uint64 { - if m != nil { - return m.CurrentCid - } - return 0 -} - -func (m *NsStatResponse) GetMemVirtual() uint64 { - if m != nil { - return m.MemVirtual - } - return 0 -} - -func (m *NsStatResponse) GetMemResident() uint64 { - if m != nil { - return m.MemResident - } - return 0 -} - -func (m *NsStatResponse) GetMemShare() uint64 { - if m != nil { - return m.MemShare - } - return 0 -} - -func (m *NsStatResponse) GetMemGrowth() uint64 { - if m != nil { - return m.MemGrowth - } - return 0 -} - -func (m *NsStatResponse) GetThreads() uint64 { - if m != nil { - return m.Threads - } - return 0 -} - -func (m *NsStatResponse) GetFds() uint64 { - if m != nil { - return m.Fds - } - return 0 -} - -func (m *NsStatResponse) GetUptime() uint64 { - if m != nil { - return m.Uptime - } - return 0 -} - -type ManilaRequest struct { - RequestType MANILA_REQUEST_TYPE `protobuf:"varint,1,opt,name=request_type,json=requestType,proto3,enum=eos.rpc.MANILA_REQUEST_TYPE" json:"request_type,omitempty"` - AuthKey string `protobuf:"bytes,2,opt,name=auth_key,json=authKey,proto3" json:"auth_key,omitempty"` - Protocol string `protobuf:"bytes,3,opt,name=protocol,proto3" json:"protocol,omitempty"` - ShareName string `protobuf:"bytes,4,opt,name=share_name,json=shareName,proto3" json:"share_name,omitempty"` - Description string `protobuf:"bytes,5,opt,name=description,proto3" json:"description,omitempty"` - ShareId string `protobuf:"bytes,6,opt,name=share_id,json=shareId,proto3" json:"share_id,omitempty"` - ShareGroupId string `protobuf:"bytes,7,opt,name=share_group_id,json=shareGroupId,proto3" json:"share_group_id,omitempty"` - Quota int32 `protobuf:"varint,8,opt,name=quota,proto3" json:"quota,omitempty"` - Creator string `protobuf:"bytes,9,opt,name=creator,proto3" json:"creator,omitempty"` - Egroup string `protobuf:"bytes,10,opt,name=egroup,proto3" json:"egroup,omitempty"` - AdminEgroup string `protobuf:"bytes,11,opt,name=admin_egroup,json=adminEgroup,proto3" json:"admin_egroup,omitempty"` - ShareHost string `protobuf:"bytes,12,opt,name=share_host,json=shareHost,proto3" json:"share_host,omitempty"` - ShareLocation string `protobuf:"bytes,13,opt,name=share_location,json=shareLocation,proto3" json:"share_location,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ManilaRequest) Reset() { *m = ManilaRequest{} } -func (m *ManilaRequest) String() string { return proto.CompactTextString(m) } -func (*ManilaRequest) ProtoMessage() {} -func (*ManilaRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{24} -} - -func (m *ManilaRequest) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ManilaRequest.Unmarshal(m, b) -} -func (m *ManilaRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ManilaRequest.Marshal(b, m, deterministic) -} -func (m *ManilaRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManilaRequest.Merge(m, src) -} -func (m *ManilaRequest) XXX_Size() int { - return xxx_messageInfo_ManilaRequest.Size(m) -} -func (m *ManilaRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ManilaRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_ManilaRequest proto.InternalMessageInfo - -func (m *ManilaRequest) GetRequestType() MANILA_REQUEST_TYPE { - if m != nil { - return m.RequestType - } - return MANILA_REQUEST_TYPE_CREATE_SHARE -} - -func (m *ManilaRequest) GetAuthKey() string { - if m != nil { - return m.AuthKey - } - return "" -} - -func (m *ManilaRequest) GetProtocol() string { - if m != nil { - return m.Protocol - } - return "" -} - -func (m *ManilaRequest) GetShareName() string { - if m != nil { - return m.ShareName - } - return "" -} - -func (m *ManilaRequest) GetDescription() string { - if m != nil { - return m.Description - } - return "" -} - -func (m *ManilaRequest) GetShareId() string { - if m != nil { - return m.ShareId - } - return "" -} - -func (m *ManilaRequest) GetShareGroupId() string { - if m != nil { - return m.ShareGroupId - } - return "" -} - -func (m *ManilaRequest) GetQuota() int32 { - if m != nil { - return m.Quota - } - return 0 -} - -func (m *ManilaRequest) GetCreator() string { - if m != nil { - return m.Creator - } - return "" -} - -func (m *ManilaRequest) GetEgroup() string { - if m != nil { - return m.Egroup - } - return "" -} - -func (m *ManilaRequest) GetAdminEgroup() string { - if m != nil { - return m.AdminEgroup - } - return "" -} - -func (m *ManilaRequest) GetShareHost() string { - if m != nil { - return m.ShareHost - } - return "" -} - -func (m *ManilaRequest) GetShareLocation() string { - if m != nil { - return m.ShareLocation - } - return "" -} - -type ManilaResponse struct { - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` - Code int32 `protobuf:"varint,2,opt,name=code,proto3" json:"code,omitempty"` - TotalUsed int64 `protobuf:"varint,3,opt,name=total_used,json=totalUsed,proto3" json:"total_used,omitempty"` - TotalCapacity int64 `protobuf:"varint,4,opt,name=total_capacity,json=totalCapacity,proto3" json:"total_capacity,omitempty"` - NewShareQuota int64 `protobuf:"varint,5,opt,name=new_share_quota,json=newShareQuota,proto3" json:"new_share_quota,omitempty"` - NewSharePath string `protobuf:"bytes,6,opt,name=new_share_path,json=newSharePath,proto3" json:"new_share_path,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *ManilaResponse) Reset() { *m = ManilaResponse{} } -func (m *ManilaResponse) String() string { return proto.CompactTextString(m) } -func (*ManilaResponse) ProtoMessage() {} -func (*ManilaResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_e33e25ec398e9bf1, []int{25} -} - -func (m *ManilaResponse) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_ManilaResponse.Unmarshal(m, b) -} -func (m *ManilaResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_ManilaResponse.Marshal(b, m, deterministic) -} -func (m *ManilaResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ManilaResponse.Merge(m, src) -} -func (m *ManilaResponse) XXX_Size() int { - return xxx_messageInfo_ManilaResponse.Size(m) -} -func (m *ManilaResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ManilaResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_ManilaResponse proto.InternalMessageInfo - -func (m *ManilaResponse) GetMsg() string { - if m != nil { - return m.Msg - } - return "" -} - -func (m *ManilaResponse) GetCode() int32 { - if m != nil { - return m.Code - } - return 0 -} - -func (m *ManilaResponse) GetTotalUsed() int64 { - if m != nil { - return m.TotalUsed - } - return 0 -} - -func (m *ManilaResponse) GetTotalCapacity() int64 { - if m != nil { - return m.TotalCapacity - } - return 0 -} - -func (m *ManilaResponse) GetNewShareQuota() int64 { - if m != nil { - return m.NewShareQuota - } - return 0 -} - -func (m *ManilaResponse) GetNewSharePath() string { - if m != nil { - return m.NewSharePath - } - return "" -} - -func init() { - proto.RegisterEnum("eos.rpc.TYPE", TYPE_name, TYPE_value) - proto.RegisterEnum("eos.rpc.QUOTATYPE", QUOTATYPE_name, QUOTATYPE_value) - proto.RegisterEnum("eos.rpc.MANILA_REQUEST_TYPE", MANILA_REQUEST_TYPE_name, MANILA_REQUEST_TYPE_value) - proto.RegisterEnum("eos.rpc.NSRequest_VersionRequest_VERSION_CMD", NSRequest_VersionRequest_VERSION_CMD_name, NSRequest_VersionRequest_VERSION_CMD_value) - proto.RegisterEnum("eos.rpc.NSRequest_RecycleRequest_RECYCLE_CMD", NSRequest_RecycleRequest_RECYCLE_CMD_name, NSRequest_RecycleRequest_RECYCLE_CMD_value) - proto.RegisterEnum("eos.rpc.NSRequest_AclRequest_ACL_COMMAND", NSRequest_AclRequest_ACL_COMMAND_name, NSRequest_AclRequest_ACL_COMMAND_value) - proto.RegisterEnum("eos.rpc.NSRequest_AclRequest_ACL_TYPE", NSRequest_AclRequest_ACL_TYPE_name, NSRequest_AclRequest_ACL_TYPE_value) - proto.RegisterEnum("eos.rpc.NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE", NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_name, NSResponse_RecycleResponse_RecycleInfo_DELETIONTYPE_value) - proto.RegisterType((*PingRequest)(nil), "eos.rpc.PingRequest") - proto.RegisterType((*PingReply)(nil), "eos.rpc.PingReply") - proto.RegisterType((*ContainerInsertRequest)(nil), "eos.rpc.ContainerInsertRequest") - proto.RegisterType((*FileInsertRequest)(nil), "eos.rpc.FileInsertRequest") - proto.RegisterType((*InsertReply)(nil), "eos.rpc.InsertReply") - proto.RegisterType((*Time)(nil), "eos.rpc.Time") - proto.RegisterType((*Checksum)(nil), "eos.rpc.Checksum") - proto.RegisterType((*FileMdProto)(nil), "eos.rpc.FileMdProto") - proto.RegisterMapType((map[string][]byte)(nil), "eos.rpc.FileMdProto.XattrsEntry") - proto.RegisterType((*ContainerMdProto)(nil), "eos.rpc.ContainerMdProto") - proto.RegisterMapType((map[string][]byte)(nil), "eos.rpc.ContainerMdProto.XattrsEntry") - proto.RegisterType((*QuotaProto)(nil), "eos.rpc.QuotaProto") - proto.RegisterType((*RoleId)(nil), "eos.rpc.RoleId") - proto.RegisterType((*MDId)(nil), "eos.rpc.MDId") - proto.RegisterType((*Limit)(nil), "eos.rpc.Limit") - proto.RegisterType((*MDSelection)(nil), "eos.rpc.MDSelection") - proto.RegisterMapType((map[string][]byte)(nil), "eos.rpc.MDSelection.XattrEntry") - proto.RegisterType((*MDRequest)(nil), "eos.rpc.MDRequest") - proto.RegisterType((*MDResponse)(nil), "eos.rpc.MDResponse") - proto.RegisterType((*FindRequest)(nil), "eos.rpc.FindRequest") - proto.RegisterType((*ShareAuth)(nil), "eos.rpc.ShareAuth") - proto.RegisterType((*ShareProto)(nil), "eos.rpc.ShareProto") - proto.RegisterType((*ShareToken)(nil), "eos.rpc.ShareToken") - proto.RegisterType((*NSRequest)(nil), "eos.rpc.NSRequest") - proto.RegisterType((*NSRequest_MkdirRequest)(nil), "eos.rpc.NSRequest.MkdirRequest") - proto.RegisterType((*NSRequest_RmdirRequest)(nil), "eos.rpc.NSRequest.RmdirRequest") - proto.RegisterType((*NSRequest_TouchRequest)(nil), "eos.rpc.NSRequest.TouchRequest") - proto.RegisterType((*NSRequest_UnlinkRequest)(nil), "eos.rpc.NSRequest.UnlinkRequest") - proto.RegisterType((*NSRequest_RmRequest)(nil), "eos.rpc.NSRequest.RmRequest") - proto.RegisterType((*NSRequest_RenameRequest)(nil), "eos.rpc.NSRequest.RenameRequest") - proto.RegisterType((*NSRequest_SymlinkRequest)(nil), "eos.rpc.NSRequest.SymlinkRequest") - proto.RegisterType((*NSRequest_VersionRequest)(nil), "eos.rpc.NSRequest.VersionRequest") - proto.RegisterType((*NSRequest_RecycleRequest)(nil), "eos.rpc.NSRequest.RecycleRequest") - proto.RegisterType((*NSRequest_RecycleRequest_RestoreFlags)(nil), "eos.rpc.NSRequest.RecycleRequest.RestoreFlags") - proto.RegisterType((*NSRequest_RecycleRequest_PurgeDate)(nil), "eos.rpc.NSRequest.RecycleRequest.PurgeDate") - proto.RegisterType((*NSRequest_SetXAttrRequest)(nil), "eos.rpc.NSRequest.SetXAttrRequest") - proto.RegisterMapType((map[string][]byte)(nil), "eos.rpc.NSRequest.SetXAttrRequest.XattrsEntry") - proto.RegisterType((*NSRequest_ChownRequest)(nil), "eos.rpc.NSRequest.ChownRequest") - proto.RegisterType((*NSRequest_ChmodRequest)(nil), "eos.rpc.NSRequest.ChmodRequest") - proto.RegisterType((*NSRequest_AclRequest)(nil), "eos.rpc.NSRequest.AclRequest") - proto.RegisterType((*NSRequest_TokenRequest)(nil), "eos.rpc.NSRequest.TokenRequest") - proto.RegisterType((*NSRequest_QuotaRequest)(nil), "eos.rpc.NSRequest.QuotaRequest") - proto.RegisterType((*NSResponse)(nil), "eos.rpc.NSResponse") - proto.RegisterType((*NSResponse_ErrorResponse)(nil), "eos.rpc.NSResponse.ErrorResponse") - proto.RegisterType((*NSResponse_VersionResponse)(nil), "eos.rpc.NSResponse.VersionResponse") - proto.RegisterType((*NSResponse_VersionResponse_VersionInfo)(nil), "eos.rpc.NSResponse.VersionResponse.VersionInfo") - proto.RegisterType((*NSResponse_RecycleResponse)(nil), "eos.rpc.NSResponse.RecycleResponse") - proto.RegisterType((*NSResponse_RecycleResponse_RecycleInfo)(nil), "eos.rpc.NSResponse.RecycleResponse.RecycleInfo") - proto.RegisterType((*NSResponse_AclResponse)(nil), "eos.rpc.NSResponse.AclResponse") - proto.RegisterType((*NSResponse_QuotaResponse)(nil), "eos.rpc.NSResponse.QuotaResponse") - proto.RegisterType((*NsStatRequest)(nil), "eos.rpc.NsStatRequest") - proto.RegisterType((*NsStatResponse)(nil), "eos.rpc.NsStatResponse") - proto.RegisterType((*ManilaRequest)(nil), "eos.rpc.ManilaRequest") - proto.RegisterType((*ManilaResponse)(nil), "eos.rpc.ManilaResponse") -} - -func init() { proto.RegisterFile("eos_grpc.proto", fileDescriptor_e33e25ec398e9bf1) } - -var fileDescriptor_e33e25ec398e9bf1 = []byte{ - // 3448 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x5a, 0x4f, 0x73, 0xe3, 0x46, - 0x76, 0x1f, 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 0xb7, 0xb6, 0x04, 0x15, 0x1b, 0xbc, - 0xf4, 0xc3, 0xee, 0x49, 0x14, 0x86, 0x09, 0xe6, 0xc4, 0x2a, 0x35, 0x91, 0x42, 0xc3, 0x30, 0xe1, - 0xdd, 0x88, 0x13, 0xdd, 0xef, 0x88, 0x6e, 0xa4, 0x60, 0xf7, 0x9f, 0xc3, 0x56, 0xc4, 0xa6, 0xec, - 0x7c, 0x3e, 0xe1, 0x1e, 0x88, 0xde, 0x42, 0xd0, 0x19, 0x36, 0x05, 0x79, 0x4f, 0x52, 0xc9, 0x63, - 0x90, 0x94, 0x89, 0xeb, 0x09, 0x97, 0xbb, 0x8d, 0xb8, 0x86, 0xa0, 0xee, 0x0a, 0x22, 0xf9, 0x14, - 0xca, 0x18, 0xe7, 0x5b, 0x77, 0x30, 0x37, 0x3c, 0xcc, 0x56, 0xa9, 0x18, 0xb3, 0x48, 0x0b, 0x22, - 0x2b, 0x08, 0x74, 0xfb, 0x73, 0x80, 0x9c, 0xf8, 0xa3, 0xe2, 0xff, 0xef, 0x35, 0x30, 0x0f, 0x77, - 0xd3, 0x9a, 0x36, 0x75, 0x4d, 0x6d, 0xa5, 0x6b, 0x92, 0x07, 0x99, 0x7f, 0xab, 0x09, 0x8e, 0x87, - 0x03, 0x74, 0x77, 0xa5, 0xd2, 0xd5, 0x8b, 0x35, 0xf6, 0x23, 0x30, 0xa2, 0x70, 0x96, 0x7a, 0xc7, - 0x56, 0xc6, 0x2a, 0x22, 0x16, 0xc5, 0x4e, 0xf2, 0x0c, 0xcc, 0x38, 0x5d, 0xa7, 0x74, 0x91, 0x3b, - 0xcb, 0x74, 0x40, 0x73, 0x98, 0xf5, 0x77, 0x1a, 0x00, 0x5f, 0x42, 0x3c, 0x0f, 0x83, 0x98, 0xdd, - 0x64, 0x0d, 0x1f, 0x81, 0x7e, 0xe2, 0xa7, 0x8b, 0x58, 0x5e, 0xb8, 0x73, 0x00, 0xf9, 0x19, 0xe8, - 0x8e, 0x3c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59, - 0x16, 0xfd, 0x0a, 0x36, 0xde, 0xb0, 0x08, 0xbd, 0xec, 0xfe, 0x4a, 0xf6, 0xef, 0x04, 0x42, 0x61, - 0x97, 0x3c, 0x9c, 0x3d, 0x62, 0xce, 0x85, 0x33, 0x63, 0xad, 0x07, 0x2b, 0xd9, 0xa9, 0x40, 0x28, - 0xec, 0x92, 0x87, 0x7c, 0x91, 0xa6, 0xb6, 0xf7, 0x91, 0xd9, 0x5a, 0x36, 0x75, 0x96, 0xbc, 0xea, - 0x26, 0x89, 0xba, 0xb3, 0xc8, 0xc2, 0x77, 0xd6, 0x39, 0x0d, 0xdf, 0x06, 0xad, 0x87, 0x2b, 0x77, - 0xb6, 0xc7, 0xfb, 0x15, 0x46, 0xc4, 0x0b, 0x46, 0x3f, 0x74, 0x5b, 0xdb, 0xd7, 0x30, 0xfa, 0xa1, - 0x5b, 0x60, 0xf4, 0x43, 0x97, 0x7c, 0x02, 0xba, 0xed, 0xcc, 0x5a, 0x1f, 0x20, 0xdb, 0x83, 0x25, - 0x6c, 0x5d, 0x67, 0x96, 0x33, 0x71, 0xac, 0x30, 0x3f, 0xee, 0xba, 0xd6, 0x35, 0xe6, 0x77, 0xc6, - 0x82, 0x82, 0xf9, 0x71, 0x47, 0xfe, 0x0c, 0xca, 0xbf, 0xe1, 0x47, 0xb0, 0xd6, 0xa3, 0x95, 0x8c, - 0x78, 0x44, 0x53, 0x18, 0x11, 0xdf, 0x9e, 0x40, 0x5d, 0x75, 0x21, 0x99, 0x4f, 0xb4, 0x55, 0xf9, - 0xe4, 0x3e, 0x98, 0x11, 0x73, 0x16, 0x51, 0xec, 0xbd, 0x11, 0xbe, 0x5b, 0xa5, 0x39, 0x21, 0x3b, - 0x44, 0xeb, 0x78, 0xb8, 0xc6, 0xef, 0xf6, 0x53, 0xa8, 0xab, 0xae, 0xb6, 0x66, 0x00, 0x0e, 0x57, - 0x1d, 0x6c, 0x1d, 0xfc, 0x00, 0x1a, 0x05, 0xaf, 0xba, 0xc1, 0xfc, 0x83, 0x30, 0x35, 0x41, 0x79, - 0x49, 0x97, 0x11, 0xda, 0x27, 0x60, 0x66, 0xbe, 0xf6, 0xa7, 0x69, 0xe2, 0xfa, 0x71, 0xf6, 0xa0, - 0x51, 0xf0, 0xcf, 0x75, 0x63, 0xdd, 0x85, 0x4a, 0x62, 0x47, 0x53, 0x96, 0xc8, 0x18, 0x2d, 0x5b, - 0xed, 0x7d, 0xd8, 0x2c, 0xba, 0xea, 0x1f, 0x2b, 0xe8, 0xf7, 0x1a, 0x6c, 0x16, 0xbd, 0x76, 0x9d, - 0xa4, 0xaf, 0x45, 0x5d, 0x53, 0xc2, 0xca, 0xe4, 0xe9, 0xda, 0x20, 0xd0, 0xf9, 0xae, 0x4f, 0x47, - 0x83, 0xa3, 0xe1, 0xa4, 0x77, 0xb8, 0x8b, 0xb5, 0x0e, 0x4f, 0x2e, 0xbe, 0x7d, 0x9e, 0x06, 0x13, - 0x1d, 0x53, 0x88, 0x42, 0xb1, 0x3a, 0x50, 0x53, 0x78, 0x08, 0x40, 0xa5, 0x47, 0xfb, 0xdd, 0x71, - 0xbf, 0x79, 0x8b, 0x98, 0x50, 0x3e, 0x7e, 0x49, 0xf7, 0xfb, 0x4d, 0x8d, 0x54, 0xc1, 0x38, 0x18, - 0x8c, 0xc6, 0xcd, 0x52, 0xfb, 0xbf, 0x74, 0xd8, 0x2c, 0x46, 0x8e, 0x25, 0x45, 0xec, 0xda, 0x59, - 0x17, 0x25, 0x74, 0x68, 0xbf, 0xf7, 0xba, 0x77, 0xd0, 0xcf, 0x67, 0x7d, 0x0c, 0xb5, 0x88, 0xc5, - 0x49, 0x18, 0x31, 0x7e, 0xde, 0x90, 0x65, 0x55, 0xe7, 0x06, 0x82, 0x04, 0xd3, 0x1e, 0x3f, 0xa4, - 0x50, 0x55, 0x04, 0x19, 0x80, 0x39, 0x5f, 0x44, 0x53, 0xe6, 0xda, 0x49, 0x5a, 0xd8, 0xfe, 0x6c, - 0xbd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 0x5f, 0x42, 0x45, 0xc4, 0x78, 0x72, 0x37, - 0x4f, 0xa3, 0x6a, 0x82, 0x68, 0xbf, 0x7b, 0x85, 0x9e, 0xb2, 0x93, 0x5f, 0xc3, 0xd6, 0xa5, 0xff, - 0xbd, 0xc8, 0xc3, 0xab, 0x2f, 0x2e, 0x85, 0x5f, 0xb0, 0xda, 0xf9, 0xfc, 0x94, 0x7f, 0xa8, 0xac, - 0x5b, 0xe4, 0x6f, 0x00, 0xf2, 0xff, 0xb5, 0x48, 0xbb, 0xf0, 0xc0, 0x73, 0x33, 0x09, 0x9f, 0x80, - 0xd1, 0x3f, 0x67, 0x8e, 0xa2, 0xb6, 0xec, 0x64, 0xa2, 0xac, 0x3f, 0xaf, 0x11, 0xac, 0x5b, 0xe4, - 0x39, 0xdc, 0x16, 0x6e, 0x37, 0x62, 0xd1, 0x1b, 0x96, 0x9d, 0x77, 0x73, 0x55, 0x14, 0x22, 0xaa, - 0xa2, 0x8a, 0xa2, 0xb3, 0x5a, 0xb7, 0xbe, 0x79, 0x0a, 0x5b, 0x5e, 0xd8, 0xc1, 0xff, 0xef, 0x24, - 0xe6, 0x9b, 0x6a, 0x3f, 0x8c, 0x31, 0xff, 0x1e, 0x6b, 0x7f, 0x5b, 0x4d, 0xff, 0xce, 0xfb, 0x97, - 0x92, 0xde, 0x3f, 0x1a, 0x7d, 0x5f, 0xc1, 0x68, 0xf9, 0x97, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, - 0x43, 0x63, 0x07, 0x71, 0xb6, 0x27, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// EosClient is the client API for Eos service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type EosClient interface { - // Replies to a ping - Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) - // Replies to MD requests with a stream - MD(ctx context.Context, in *MDRequest, opts ...grpc.CallOption) (Eos_MDClient, error) - // Replies to Find requests with a stream - Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (Eos_FindClient, error) - // Replies to a NsStat operation - NsStat(ctx context.Context, in *NsStatRequest, opts ...grpc.CallOption) (*NsStatResponse, error) - // Replies to an insert - ContainerInsert(ctx context.Context, in *ContainerInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) - FileInsert(ctx context.Context, in *FileInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) - // Replies to a NsRequest operation - Exec(ctx context.Context, in *NSRequest, opts ...grpc.CallOption) (*NSResponse, error) - // Manila Driver - ManilaServerRequest(ctx context.Context, in *ManilaRequest, opts ...grpc.CallOption) (*ManilaResponse, error) -} - -type eosClient struct { - cc *grpc.ClientConn -} - -func NewEosClient(cc *grpc.ClientConn) EosClient { - return &eosClient{cc} -} - -func (c *eosClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingReply, error) { - out := new(PingReply) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/Ping", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eosClient) MD(ctx context.Context, in *MDRequest, opts ...grpc.CallOption) (Eos_MDClient, error) { - stream, err := c.cc.NewStream(ctx, &_Eos_serviceDesc.Streams[0], "/eos.rpc.Eos/MD", opts...) - if err != nil { - return nil, err - } - x := &eosMDClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Eos_MDClient interface { - Recv() (*MDResponse, error) - grpc.ClientStream -} - -type eosMDClient struct { - grpc.ClientStream -} - -func (x *eosMDClient) Recv() (*MDResponse, error) { - m := new(MDResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *eosClient) Find(ctx context.Context, in *FindRequest, opts ...grpc.CallOption) (Eos_FindClient, error) { - stream, err := c.cc.NewStream(ctx, &_Eos_serviceDesc.Streams[1], "/eos.rpc.Eos/Find", opts...) - if err != nil { - return nil, err - } - x := &eosFindClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Eos_FindClient interface { - Recv() (*MDResponse, error) - grpc.ClientStream -} - -type eosFindClient struct { - grpc.ClientStream -} - -func (x *eosFindClient) Recv() (*MDResponse, error) { - m := new(MDResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *eosClient) NsStat(ctx context.Context, in *NsStatRequest, opts ...grpc.CallOption) (*NsStatResponse, error) { - out := new(NsStatResponse) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/NsStat", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eosClient) ContainerInsert(ctx context.Context, in *ContainerInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) { - out := new(InsertReply) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/ContainerInsert", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eosClient) FileInsert(ctx context.Context, in *FileInsertRequest, opts ...grpc.CallOption) (*InsertReply, error) { - out := new(InsertReply) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/FileInsert", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eosClient) Exec(ctx context.Context, in *NSRequest, opts ...grpc.CallOption) (*NSResponse, error) { - out := new(NSResponse) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/Exec", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *eosClient) ManilaServerRequest(ctx context.Context, in *ManilaRequest, opts ...grpc.CallOption) (*ManilaResponse, error) { - out := new(ManilaResponse) - err := c.cc.Invoke(ctx, "/eos.rpc.Eos/ManilaServerRequest", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// EosServer is the server API for Eos service. -type EosServer interface { - // Replies to a ping - Ping(context.Context, *PingRequest) (*PingReply, error) - // Replies to MD requests with a stream - MD(*MDRequest, Eos_MDServer) error - // Replies to Find requests with a stream - Find(*FindRequest, Eos_FindServer) error - // Replies to a NsStat operation - NsStat(context.Context, *NsStatRequest) (*NsStatResponse, error) - // Replies to an insert - ContainerInsert(context.Context, *ContainerInsertRequest) (*InsertReply, error) - FileInsert(context.Context, *FileInsertRequest) (*InsertReply, error) - // Replies to a NsRequest operation - Exec(context.Context, *NSRequest) (*NSResponse, error) - // Manila Driver - ManilaServerRequest(context.Context, *ManilaRequest) (*ManilaResponse, error) -} - -// UnimplementedEosServer can be embedded to have forward compatible implementations. -type UnimplementedEosServer struct { -} - -func (*UnimplementedEosServer) Ping(ctx context.Context, req *PingRequest) (*PingReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") -} -func (*UnimplementedEosServer) MD(req *MDRequest, srv Eos_MDServer) error { - return status.Errorf(codes.Unimplemented, "method MD not implemented") -} -func (*UnimplementedEosServer) Find(req *FindRequest, srv Eos_FindServer) error { - return status.Errorf(codes.Unimplemented, "method Find not implemented") -} -func (*UnimplementedEosServer) NsStat(ctx context.Context, req *NsStatRequest) (*NsStatResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method NsStat not implemented") -} -func (*UnimplementedEosServer) ContainerInsert(ctx context.Context, req *ContainerInsertRequest) (*InsertReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method ContainerInsert not implemented") -} -func (*UnimplementedEosServer) FileInsert(ctx context.Context, req *FileInsertRequest) (*InsertReply, error) { - return nil, status.Errorf(codes.Unimplemented, "method FileInsert not implemented") -} -func (*UnimplementedEosServer) Exec(ctx context.Context, req *NSRequest) (*NSResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") -} -func (*UnimplementedEosServer) ManilaServerRequest(ctx context.Context, req *ManilaRequest) (*ManilaResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ManilaServerRequest not implemented") -} - -func RegisterEosServer(s *grpc.Server, srv EosServer) { - s.RegisterService(&_Eos_serviceDesc, srv) -} - -func _Eos_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).Ping(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/Ping", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).Ping(ctx, req.(*PingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Eos_MD_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(MDRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(EosServer).MD(m, &eosMDServer{stream}) -} - -type Eos_MDServer interface { - Send(*MDResponse) error - grpc.ServerStream -} - -type eosMDServer struct { - grpc.ServerStream -} - -func (x *eosMDServer) Send(m *MDResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Eos_Find_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FindRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(EosServer).Find(m, &eosFindServer{stream}) -} - -type Eos_FindServer interface { - Send(*MDResponse) error - grpc.ServerStream -} - -type eosFindServer struct { - grpc.ServerStream -} - -func (x *eosFindServer) Send(m *MDResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Eos_NsStat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NsStatRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).NsStat(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/NsStat", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).NsStat(ctx, req.(*NsStatRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Eos_ContainerInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ContainerInsertRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).ContainerInsert(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/ContainerInsert", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).ContainerInsert(ctx, req.(*ContainerInsertRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Eos_FileInsert_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(FileInsertRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).FileInsert(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/FileInsert", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).FileInsert(ctx, req.(*FileInsertRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Eos_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(NSRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).Exec(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/Exec", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).Exec(ctx, req.(*NSRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Eos_ManilaServerRequest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ManilaRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(EosServer).ManilaServerRequest(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/eos.rpc.Eos/ManilaServerRequest", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(EosServer).ManilaServerRequest(ctx, req.(*ManilaRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Eos_serviceDesc = grpc.ServiceDesc{ - ServiceName: "eos.rpc.Eos", - HandlerType: (*EosServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Ping", - Handler: _Eos_Ping_Handler, - }, - { - MethodName: "NsStat", - Handler: _Eos_NsStat_Handler, - }, - { - MethodName: "ContainerInsert", - Handler: _Eos_ContainerInsert_Handler, - }, - { - MethodName: "FileInsert", - Handler: _Eos_FileInsert_Handler, - }, - { - MethodName: "Exec", - Handler: _Eos_Exec_Handler, - }, - { - MethodName: "ManilaServerRequest", - Handler: _Eos_ManilaServerRequest_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "MD", - Handler: _Eos_MD_Handler, - ServerStreams: true, - }, - { - StreamName: "Find", - Handler: _Eos_Find_Handler, - ServerStreams: true, - }, - }, - Metadata: "eos_grpc.proto", -} diff --git a/pkg/storage/fs/eos/eos.go b/pkg/storage/fs/eos/eos.go index cfe18e6cd0..be20be9892 100644 --- a/pkg/storage/fs/eos/eos.go +++ b/pkg/storage/fs/eos/eos.go @@ -19,9 +19,6 @@ package eos import ( - "bytes" - "encoding/gob" - "github.com/cs3org/reva/pkg/storage" "github.com/cs3org/reva/pkg/storage/fs/registry" "github.com/cs3org/reva/pkg/storage/utils/eosfs" @@ -33,73 +30,8 @@ func init() { registry.Register("eos", New) } -type config struct { - // Namespace for metadata operations - Namespace string `mapstructure:"namespace" docs:"/"` - - // ShadowNamespace for storing shadow data - ShadowNamespace string `mapstructure:"shadow_namespace" docs:"/.shadow"` - - // UploadsNamespace for storing upload data - UploadsNamespace string `mapstructure:"uploads_namespace" docs:"/.uploads"` - - // ShareFolder defines the name of the folder in the - // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares - ShareFolder string `mapstructure:"share_folder" docs:"/MyShares"` - - // Location of the eos binary. - // Default is /usr/bin/eos. - EosBinary string `mapstructure:"eos_binary" docs:"/usr/bin/eos"` - - // Location of the xrdcopy binary. - // Default is /usr/bin/xrdcopy. - XrdcopyBinary string `mapstructure:"xrdcopy_binary" docs:"/usr/bin/xrdcopy"` - - // URL of the Master EOS MGM. - // Default is root://eos-example.org - MasterURL string `mapstructure:"master_url" docs:"root://eos-example.org"` - - // URL of the Slave EOS MGM. - // Default is root://eos-example.org - SlaveURL string `mapstructure:"slave_url" docs:"root://eos-example.org"` - - // Location on the local fs where to store reads. - // Defaults to os.TempDir() - CacheDirectory string `mapstructure:"cache_directory" docs:"/var/tmp/"` - - // SecProtocol specifies the xrootd security protocol to use between the server and EOS. - SecProtocol string `mapstructure:"sec_protocol" docs:"-"` - - // Keytab specifies the location of the keytab to use to authenticate to EOS. - Keytab string `mapstructure:"keytab" docs:"-"` - - // SingleUsername is the username to use when SingleUserMode is enabled - SingleUsername string `mapstructure:"single_username" docs:"-"` - - // Enables logging of the commands executed - // Defaults to false - EnableLogging bool `mapstructure:"enable_logging" docs:"false"` - - // ShowHiddenSysFiles shows internal EOS files like - // .sys.v# and .sys.a# files. - ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files" docs:"false"` - - // ForceSingleUserMode will force connections to EOS to use SingleUsername - ForceSingleUserMode bool `mapstructure:"force_single_user_mode" docs:"false"` - - // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. - UseKeytab bool `mapstructure:"use_keytab" docs:"false"` - - // Whether to maintain the same inode across various versions of a file. - // Requires extra metadata operations if set to true - VersionInvariant bool `mapstructure:"version_invariant" docs:"true"` - - // GatewaySvc stores the endpoint at which the GRPC gateway is exposed. - GatewaySvc string `mapstructure:"gatewaysvc" docs:"0.0.0.0:19000"` -} - -func parseConfig(m map[string]interface{}) (*config, error) { - c := &config{} +func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { + c := &eosfs.Config{} if err := mapstructure.Decode(m, c); err != nil { err = errors.Wrap(err, "error decoding conf") return nil, err @@ -120,16 +52,5 @@ func New(m map[string]interface{}) (storage.FS, error) { return nil, err } - var buf bytes.Buffer - err = gob.NewEncoder(&buf).Encode(&c) - if err != nil { - return nil, err - } - var conf eosfs.Config - err = gob.NewDecoder(&buf).Decode(&conf) - if err != nil { - return nil, err - } - - return eosfs.NewEOSFS(&conf) + return eosfs.NewEOSFS(c) } diff --git a/pkg/storage/fs/eosgrpc/eosgrpc.go b/pkg/storage/fs/eosgrpc/eosgrpc.go index 730be34f0d..0b8b030288 100644 --- a/pkg/storage/fs/eosgrpc/eosgrpc.go +++ b/pkg/storage/fs/eosgrpc/eosgrpc.go @@ -19,1562 +19,39 @@ package eosgrpc import ( - "context" - "encoding/json" - "fmt" - "io" - "net/url" - "os" - gouser "os/user" - "path" - "regexp" - "strconv" - "strings" - - "github.com/cs3org/reva/pkg/appctx" - "github.com/cs3org/reva/pkg/eosclientgrpc" - "github.com/cs3org/reva/pkg/mime" "github.com/cs3org/reva/pkg/storage" "github.com/cs3org/reva/pkg/storage/fs/registry" - "github.com/cs3org/reva/pkg/storage/utils/acl" - "github.com/cs3org/reva/pkg/storage/utils/templates" - "github.com/cs3org/reva/pkg/user" + "github.com/cs3org/reva/pkg/storage/utils/eosfs" "github.com/mitchellh/mapstructure" "github.com/pkg/errors" - - userpb "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" - provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" - types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" - "github.com/cs3org/reva/pkg/errtypes" -) - -const ( - refTargetAttrKey = "reva.target" ) func init() { - registry.Register("eosgrpc", New) } -var hiddenReg = regexp.MustCompile(`\.sys\..#.`) - -type eosfs struct { - c *eosclientgrpc.Client - conf *config -} - -func parseConfig(m map[string]interface{}) (*config, error) { - c := &config{} +func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { + c := &eosfs.Config{} if err := mapstructure.Decode(m, c); err != nil { + err = errors.Wrap(err, "error decoding conf") return nil, err } - return c, nil -} - -// Options are the configuration options to pass to the New function. -type config struct { - // Namespace for metadata operations - Namespace string `mapstructure:"namespace" docs:"/"` - - // ShadowNamespace for storing shadow data - ShadowNamespace string `mapstructure:"shadow_namespace" docs:"/.shadow"` - - // ShareFolder defines the name of the folder in the - // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares - ShareFolder string `mapstructure:"share_folder" docs:"/MyShares"` - - // Location of the eos binary. - // Default is /usr/bin/eos. - EosBinary string `mapstructure:"eos_binary" docs:"/usr/bin/eos"` - - // Location of the xrdcopy binary. - // Default is /usr/bin/xrdcopy. - XrdcopyBinary string `mapstructure:"xrdcopy_binary" docs:"/usr/bin/xrdcopy"` - - // URL of the Master EOS MGM. - // Default is root://eos-example.org - MasterURL string `mapstructure:"master_url" docs:"root://eos-example.org"` - - // URI of the EOS MGM grpc server - // Default is empty - GrpcURI string `mapstructure:"master_grpc_uri" docs:"root://eos-grpc-example.org"` - - // URL of the Slave EOS MGM. - // Default is root://eos-example.org - SlaveURL string `mapstructure:"slave_url" docs:"root://eos-example.org"` - - // Location on the local fs where to store reads. - // Defaults to os.TempDir() - CacheDirectory string `mapstructure:"cache_directory" docs:"/var/tmp/"` - - // SecProtocol specifies the xrootd security protocol to use between the server and EOS. - SecProtocol string `mapstructure:"sec_protocol" docs:"-"` - - // Keytab specifies the location of the keytab to use to authenticate to EOS. - Keytab string `mapstructure:"keytab"` - - // SingleUsername is the username to use when SingleUserMode is enabled - SingleUsername string `mapstructure:"single_username"` - - // UserLayout wraps the internal path with user information. - // Example: if conf.Namespace is /eos/user and received path is /docs - // and the UserLayout is {{.Username}} the internal path will be: - // /eos/user//docs - UserLayout string `mapstructure:"user_layout" docs:"-"` - - // Enables logging of the commands executed - // Defaults to false - EnableLogging bool `mapstructure:"enable_logging" docs:"false"` - - // ShowHiddenSysFiles shows internal EOS files like - // .sys.v# and .sys.a# files. - ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files" docs:"-"` - - // ForceSingleUserMode will force connections to EOS to use SingleUsername - ForceSingleUserMode bool `mapstructure:"force_single_user_mode" docs:"false"` - - // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. - UseKeytab bool `mapstrucuture:"use_keytab" docs:"false"` - - // EnableHome enables the creation of home directories. - EnableHome bool `mapstructure:"enable_home" docs:"false"` - - // Authkey is the key that authorizes this client to connect to the GRPC service - // It's unclear whether this will be the final solution - Authkey string `mapstructure:"authkey" docs:"-"` -} - -func getUser(ctx context.Context) (*userpb.User, error) { - u, ok := user.ContextGetUser(ctx) - if !ok { - err := errors.Wrap(errtypes.UserRequired(""), "eos: error getting user from ctx") - return nil, err - } - return u, nil -} - -func (c *config) init() { - fmt.Printf("-- Initialising eosgrpc\n") - - c.Namespace = path.Clean(c.Namespace) - if !strings.HasPrefix(c.Namespace, "/") { - c.Namespace = "/" - } - - if c.ShadowNamespace == "" { - c.ShadowNamespace = path.Join(c.Namespace, ".shadow") - } - - if c.ShareFolder == "" { - c.ShareFolder = "/MyShares" - } - // ensure share folder always starts with slash - c.ShareFolder = path.Join("/", c.ShareFolder) - - if c.EosBinary == "" { - c.EosBinary = "/usr/bin/eos" - } - - if c.XrdcopyBinary == "" { - c.XrdcopyBinary = "/usr/bin/xrdcopy" - } - - if c.MasterURL == "" { - c.MasterURL = "root://eos-example.org" - } - - if c.SlaveURL == "" { - c.SlaveURL = c.MasterURL - } - if c.CacheDirectory == "" { - c.CacheDirectory = os.TempDir() + // default to version invariance if not configured + if _, ok := m["version_invariant"]; !ok { + c.VersionInvariant = true } - if c.UserLayout == "" { - c.UserLayout = "{{.Username}}" // TODO set better layout - } + return c, nil } // New returns a new implementation of the storage.FS interface that connects to EOS. func New(m map[string]interface{}) (storage.FS, error) { - c, err := parseConfig(m) if err != nil { return nil, err } - c.init() - - // bail out if keytab is not found. - if c.UseKeytab { - if _, err := os.Stat(c.Keytab); err != nil { - err = errors.Wrapf(err, "eos: keytab not accessible at location: %s", err) - return nil, err - } - } - - eosClientOpts := &eosclientgrpc.Options{ - XrdcopyBinary: c.XrdcopyBinary, - URL: c.MasterURL, - GrpcURI: c.GrpcURI, - CacheDirectory: c.CacheDirectory, - ForceSingleUserMode: c.ForceSingleUserMode, - SingleUsername: c.SingleUsername, - UseKeytab: c.UseKeytab, - Keytab: c.Keytab, - Authkey: c.Authkey, - SecProtocol: c.SecProtocol, - } - - eosClient := eosclientgrpc.New(eosClientOpts) - - eosfs := &eosfs{ - c: eosClient, - conf: c, - } - - return eosfs, nil -} - -// InitiateUpload returns upload ids corresponding to different protocols it supports -func (fs *eosfs) InitiateUpload(ctx context.Context, ref *provider.Reference, uploadLength int64, metadata map[string]string) (map[string]string, error) { - return nil, errtypes.NotSupported("op not supported") -} - -func (fs *eosfs) Shutdown(ctx context.Context) error { - // TODO(labkode): in a grpc implementation we can close connections. - return nil -} - -func (fs *eosfs) wrapShadow(ctx context.Context, fn string) (internal string) { - if fs.conf.EnableHome { - u, err := getUser(ctx) - if err != nil { - err = errors.Wrap(err, "eos: wrap: no user in ctx and home is enabled") - panic(err) - } - layout := templates.WithUser(u, fs.conf.UserLayout) - internal = path.Join(fs.conf.ShadowNamespace, layout, fn) - } else { - internal = path.Join(fs.conf.ShadowNamespace, fn) - } - return -} - -func (fs *eosfs) wrap(ctx context.Context, fn string) (internal string) { - if fs.conf.EnableHome { - layout, err := fs.GetHome(ctx) - if err != nil { - panic(err) - } - internal = path.Join(fs.conf.Namespace, layout, fn) - } else { - internal = path.Join(fs.conf.Namespace, fn) - } - log := appctx.GetLogger(ctx) - log.Debug().Msg("eos: wrap external=" + fn + " internal=" + internal) - return -} - -func (fs *eosfs) unwrap(ctx context.Context, internal string) (external string) { - log := appctx.GetLogger(ctx) - layout := fs.getLayout(ctx) - ns := fs.getNsMatch(internal, []string{fs.conf.Namespace, fs.conf.ShadowNamespace}) - external = fs.unwrapInternal(ctx, ns, internal, layout) - log.Debug().Msgf("eos: unwrap: internal=%s external=%s", internal, external) - return -} - -func (fs *eosfs) getLayout(ctx context.Context) (layout string) { - if fs.conf.EnableHome { - u, err := getUser(ctx) - if err != nil { - panic(err) - } - layout = templates.WithUser(u, fs.conf.UserLayout) - } - return -} - -func (fs *eosfs) getNsMatch(internal string, nss []string) string { - var match string - - for _, ns := range nss { - if strings.HasPrefix(internal, ns) && len(ns) > len(match) { - match = ns - } - } - - if match == "" { - panic(fmt.Sprintf("eos: path is outside namespaces: path=%s namespaces=%+v", internal, nss)) - } - - return match -} - -func (fs *eosfs) unwrapInternal(ctx context.Context, ns, np, layout string) (external string) { - log := appctx.GetLogger(ctx) - trim := path.Join(ns, layout) - - if !strings.HasPrefix(np, trim) { - panic("eos: resource is outside the directory of the logged-in user: internal=" + np + " trim=" + trim + " namespace=" + ns) - } - - external = strings.TrimPrefix(np, trim) - - if external == "" { - external = "/" - } - - log.Debug().Msgf("eos: unwrapInternal: trim=%s external=%s ns=%s np=%s", trim, external, ns, np) - - return -} - -func (fs *eosfs) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error) { - u, err := getUser(ctx) - if err != nil { - return "", errors.Wrap(err, "eos: no user in ctx") - } - - // parts[0] = 868317, parts[1] = photos, ... - parts := strings.Split(id.OpaqueId, "/") - fileID, err := strconv.ParseUint(parts[0], 10, 64) - if err != nil { - return "", errors.Wrap(err, "eos: error parsing fileid string") - } - - eosFileInfo, err := fs.c.GetFileInfoByInode(ctx, u.Username, fileID) - if err != nil { - return "", errors.Wrap(err, "eos: error getting file info by inode") - } - - fi := fs.convertToResourceInfo(ctx, eosFileInfo) - return fi.Path, nil -} - -// resolve takes in a request path or request id and returns the unwrapNominalped path. -func (fs *eosfs) resolve(ctx context.Context, u *userpb.User, ref *provider.Reference) (string, error) { - if ref.GetPath() != "" { - return ref.GetPath(), nil - } - - if ref.GetId() != nil { - p, err := fs.getPath(ctx, u, ref.GetId()) - if err != nil { - return "", err - } - - return p, nil - } - - // reference is invalid - return "", fmt.Errorf("invalid reference %+v. id and path are missing", ref) -} - -func (fs *eosfs) getPath(ctx context.Context, u *userpb.User, id *provider.ResourceId) (string, error) { - fid, err := strconv.ParseUint(id.OpaqueId, 10, 64) - if err != nil { - return "", fmt.Errorf("error converting string to int for eos fileid: %s", id.OpaqueId) - } - - eosFileInfo, err := fs.c.GetFileInfoByInode(ctx, u.Username, fid) - if err != nil { - return "", errors.Wrap(err, "eos: error getting file info by inode") - } - - return fs.unwrap(ctx, eosFileInfo.File), nil -} - -func (fs *eosfs) AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - fn := fs.wrap(ctx, p) - - eosACL, err := fs.getEosACL(g) - if err != nil { - return err - } - - err = fs.c.AddACL(ctx, u.Username, fn, eosACL) - if err != nil { - return errors.Wrap(err, "eos: error adding acl") - } - - return nil -} - -func getEosACLType(gt provider.GranteeType) (string, error) { - switch gt { - case provider.GranteeType_GRANTEE_TYPE_USER: - return "u", nil - case provider.GranteeType_GRANTEE_TYPE_GROUP: - return "g", nil - default: - return "", errors.New("no eos acl for grantee type: " + gt.String()) - } -} - -// TODO(labkode): fine grained permission controls. -func getEosACLPerm(set *provider.ResourcePermissions) (string, error) { - var b strings.Builder - - if set.Stat || set.InitiateFileDownload { - b.WriteString("r") - } - if set.CreateContainer || set.InitiateFileUpload || set.Delete || set.Move { - b.WriteString("w") - } - if set.ListContainer { - b.WriteString("x") - } - - if set.Delete { - b.WriteString("+d") - } else { - b.WriteString("!d") - } - - // TODO sharing - // TODO trash - // TODO versions - return b.String(), nil -} - -func (fs *eosfs) getEosACL(g *provider.Grant) (*acl.Entry, error) { - permissions, err := getEosACLPerm(g.Permissions) - if err != nil { - return nil, err - } - t, err := getEosACLType(g.Grantee.Type) - if err != nil { - return nil, err - } - eosACL := &acl.Entry{ - Qualifier: g.Grantee.Id.OpaqueId, - Permissions: permissions, - Type: t, - } - return eosACL, nil -} - -func (fs *eosfs) SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error { - u, err := getUser(ctx) - if err != nil { - return err - } - - log := appctx.GetLogger(ctx) - log.Info().Msg("eos: set arbitrary md for ref:" + ref.String()) - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - fn := fs.wrap(ctx, p) - - // Loop over the keyvalues of md.metadata and set them individually - for k, v := range md.Metadata { - var attr eosclientgrpc.Attribute - attr.Type = eosclientgrpc.SystemAttr - attr.Key = k - attr.Val = v - err = fs.c.SetAttr(ctx, u.Username, &attr, false, fn) - if err != nil { - return err - } - - } - return nil -} - -func (fs *eosfs) UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error { - - u, err := getUser(ctx) - if err != nil { - return err - } - - log := appctx.GetLogger(ctx) - log.Info().Msg("eos: set arbitrary md for ref:" + ref.String()) - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - fn := fs.wrap(ctx, p) - - // Loop over the keys and unset them individually - for _, k := range keys { - var attr eosclientgrpc.Attribute - attr.Key = k - - err = fs.c.UnsetAttr(ctx, u.Username, &attr, fn) - if err != nil { - return err - } - - } - return nil -} - -func (fs *eosfs) RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - eosACLType, err := getEosACLType(g.Grantee.Type) - if err != nil { - return err - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - fn := fs.wrap(ctx, p) - - err = fs.c.RemoveACL(ctx, u.Username, fn, eosACLType, g.Grantee.Id.OpaqueId) - if err != nil { - return errors.Wrap(err, "eos: error removing acl") - } - return nil -} - -func (fs *eosfs) UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - eosACL, err := fs.getEosACL(g) - if err != nil { - return errors.Wrap(err, "eos: error mapping acl") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - fn := fs.wrap(ctx, p) - - err = fs.c.AddACL(ctx, u.Username, fn, eosACL) - if err != nil { - return errors.Wrap(err, "eos: error updating acl") - } - return nil -} - -func (fs *eosfs) ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error) { - u, err := getUser(ctx) - if err != nil { - return nil, err - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - fn := fs.wrap(ctx, p) - - acls, err := fs.c.ListACLs(ctx, u.Username, fn) - if err != nil { - return nil, err - } - - grants := []*provider.Grant{} - for _, a := range acls { - grantee := &provider.Grantee{ - Id: &userpb.UserId{OpaqueId: a.Qualifier}, - Type: fs.getGranteeType(a.Type), - } - grants = append(grants, &provider.Grant{ - Grantee: grantee, - Permissions: fs.getGrantPermissionSet(a.Permissions), - }) - } - - return grants, nil -} - -func (fs *eosfs) getGranteeType(aclType string) provider.GranteeType { - switch aclType { - case "u": - return provider.GranteeType_GRANTEE_TYPE_USER - case "g": - return provider.GranteeType_GRANTEE_TYPE_GROUP - default: - return provider.GranteeType_GRANTEE_TYPE_INVALID - } -} - -// TODO(labkode): add more fine grained controls. -// EOS acls are a mix of ACLs and POSIX permissions. More details can be found in -// https://github.com/cern-eos/eos/blob/master/doc/configuration/permission.rst -// TODO we need to evaluate all acls in the list at once to properly forbid (!) and overwrite (+) permissions -// This is ugly, because those are actually negative permissions ... -func (fs *eosfs) getGrantPermissionSet(mode string) *provider.ResourcePermissions { - - // TODO also check unix permissions for read access - p := &provider.ResourcePermissions{} - // r - if strings.Contains(mode, "r") { - p.Stat = true - p.InitiateFileDownload = true - } - // w - if strings.Contains(mode, "w") { - p.CreateContainer = true - p.InitiateFileUpload = true - p.Delete = true - if p.InitiateFileDownload { - p.Move = true - } - } - if strings.Contains(mode, "wo") { - p.CreateContainer = true - // p.InitiateFileUpload = false // TODO only when the file exists - p.Delete = false - } - if strings.Contains(mode, "!d") { - p.Delete = false - } else if strings.Contains(mode, "+d") { - p.Delete = true - } - // x - if strings.Contains(mode, "x") { - p.ListContainer = true - } - - // sharing - // TODO AddGrant - // TODO ListGrants - // TODO RemoveGrant - // TODO UpdateGrant - - // trash - // TODO ListRecycle - // TODO RestoreRecycleItem - // TODO PurgeRecycle - - // versions - // TODO ListFileVersions - // TODO RestoreFileVersion - - // ? - // TODO GetPath - // TODO GetQuota - return p -} - -func (fs *eosfs) GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string) (*provider.ResourceInfo, error) { - u, err := getUser(ctx) - if err != nil { - return nil, err - } - - log := appctx.GetLogger(ctx) - log.Info().Msg("eos: get md for ref:" + ref.String()) - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - - // if path is home we need to add in the response any shadow folder in the shadow homedirectory. - if fs.conf.EnableHome { - if fs.isShareFolder(ctx, p) { - return fs.getMDShareFolder(ctx, p, mdKeys) - } - } - - fn := fs.wrap(ctx, p) - - eosFileInfo, err := fs.c.GetFileInfoByPath(ctx, u.Username, fn) - if err != nil { - return nil, err - } + c.UseGRPC = true - fi := fs.convertToResourceInfo(ctx, eosFileInfo) - return fi, nil + return eosfs.NewEOSFS(c) } - -func (fs *eosfs) getMDShareFolder(ctx context.Context, p string, mdKeys []string) (*provider.ResourceInfo, error) { - u, err := getUser(ctx) - if err != nil { - return nil, err - } - - fn := fs.wrapShadow(ctx, p) - eosFileInfo, err := fs.c.GetFileInfoByPath(ctx, u.Username, fn) - if err != nil { - return nil, err - } - // TODO(labkode): diff between root (dir) and children (ref) - - if fs.isShareFolderRoot(ctx, p) { - return fs.convertToResourceInfo(ctx, eosFileInfo), nil - } - return fs.convertToFileReference(ctx, eosFileInfo), nil -} - -func (fs *eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys []string) ([]*provider.ResourceInfo, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - - // if path is home we need to add in the response any shadow folder in the shadown homedirectory. - if fs.conf.EnableHome { - home, err := fs.GetHome(ctx) - if err != nil { - err = errors.Wrap(err, "eos: error getting home") - return nil, err - } - - if strings.HasPrefix(p, home) { - return fs.listWithHome(ctx, home, p) - } - } - - return fs.listWithNominalHome(ctx, p) -} - -func (fs *eosfs) listWithNominalHome(ctx context.Context, p string) (finfos []*provider.ResourceInfo, err error) { - log := appctx.GetLogger(ctx) - - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - fn := fs.wrap(ctx, p) - - eosFileInfos, err := fs.c.List(ctx, u.Username, fn) - if err != nil { - return nil, errors.Wrap(err, "eos: error listing") - } - - for _, eosFileInfo := range eosFileInfos { - // filter out sys files - if !fs.conf.ShowHiddenSysFiles { - base := path.Base(eosFileInfo.File) - if hiddenReg.MatchString(base) { - log.Debug().Msgf("eos: path is filtered because is considered hidden: path=%s hiddenReg=%s", base, hiddenReg) - continue - } - } - - finfos = append(finfos, fs.convertToResourceInfo(ctx, eosFileInfo)) - } - - return finfos, nil -} - -func (fs *eosfs) listWithHome(ctx context.Context, home, p string) ([]*provider.ResourceInfo, error) { - if p == home { - return fs.listHome(ctx, home) - } - - if fs.isShareFolderRoot(ctx, p) { - return fs.listShareFolderRoot(ctx, p) - } - - if fs.isShareFolderChild(ctx, p) { - return nil, errtypes.PermissionDenied("eos: error listing folders inside the shared folder, only file references are stored inside") - } - - // path points to a resource in the nominal home - return fs.listWithNominalHome(ctx, p) -} - -func (fs *eosfs) listHome(ctx context.Context, home string) ([]*provider.ResourceInfo, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - fns := []string{fs.wrap(ctx, home), fs.wrapShadow(ctx, home)} - - finfos := []*provider.ResourceInfo{} - for _, fn := range fns { - eosFileInfos, err := fs.c.List(ctx, u.Username, fn) - if err != nil { - return nil, errors.Wrap(err, "eos: error listing") - } - - for _, eosFileInfo := range eosFileInfos { - // filter out sys files - if !fs.conf.ShowHiddenSysFiles { - base := path.Base(eosFileInfo.File) - if hiddenReg.MatchString(base) { - continue - } - - } - finfos = append(finfos, fs.convertToResourceInfo(ctx, eosFileInfo)) - } - - } - return finfos, nil -} - -func (fs *eosfs) listShareFolderRoot(ctx context.Context, p string) (finfos []*provider.ResourceInfo, err error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - fn := fs.wrapShadow(ctx, p) - - eosFileInfos, err := fs.c.List(ctx, u.Username, fn) - if err != nil { - return nil, errors.Wrap(err, "eos: error listing") - } - - for _, eosFileInfo := range eosFileInfos { - // filter out sys files - if !fs.conf.ShowHiddenSysFiles { - base := path.Base(eosFileInfo.File) - if hiddenReg.MatchString(base) { - continue - } - } - - finfo := fs.convertToFileReference(ctx, eosFileInfo) - finfos = append(finfos, finfo) - } - - return finfos, nil -} - -func (fs *eosfs) GetQuota(ctx context.Context) (int, int, error) { - u, err := getUser(ctx) - if err != nil { - return 0, 0, errors.Wrap(err, "eos: no user in ctx") - } - return fs.c.GetQuota(ctx, u.Username, fs.conf.Namespace) -} - -func (fs *eosfs) GetHome(ctx context.Context) (string, error) { - if !fs.conf.EnableHome { - return "", errtypes.NotSupported("eos: get home not supported") - } - - u, err := getUser(ctx) - if err != nil { - err = errors.Wrap(err, "local: wrap: no user in ctx and home is enabled") - return "", err - } - relativeHome := templates.WithUser(u, fs.conf.UserLayout) - - return relativeHome, nil -} - -func (fs *eosfs) createShadowHome(ctx context.Context) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - home := fs.wrapShadow(ctx, "/") - _, err = fs.c.GetFileInfoByPath(ctx, "root", home) - if err == nil { // home already exists - return nil - } - - // TODO(labkode): abort on any error that is not found - if _, ok := err.(errtypes.IsNotFound); !ok { - return errors.Wrap(err, "eos: error verifying if user home directory exists") - } - - // TODO(labkode): only trigger creation on not found, copy from CERNBox logic. - err = fs.c.CreateDir(ctx, "root", home) - if err != nil { - // EOS will return success on mkdir over an existing directory. - return errors.Wrap(err, "eos: error creating dir") - } - - err = fs.c.Chown(ctx, "root", u.Username, home) - if err != nil { - return errors.Wrap(err, "eos: error chowning directory") - } - - err = fs.c.Chmod(ctx, "root", "770", home) - if err != nil { - return errors.Wrap(err, "eos: error chmoding directory") - } - - attrs := []*eosclientgrpc.Attribute{ - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "mask", - Val: "700", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "allow.oc.sync", - Val: "1", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "mtime.propagation", - Val: "1", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "forced.atomic", - Val: "1", - }, - } - - for _, attr := range attrs { - err = fs.c.SetAttr(ctx, "root", attr, true, home) - if err != nil { - return errors.Wrap(err, "eos: error setting attribute") - } - - } - - // create shadow folders - shadowFolders := []string{fs.conf.ShareFolder} - for _, sf := range shadowFolders { - sf = path.Join(home, sf) - err = fs.c.CreateDir(ctx, "root", sf) - if err != nil { - // EOS will return success on mkdir over an existing directory. - return errors.Wrap(err, "eos: error creating dir") - } - - } - - return nil -} - -func (fs *eosfs) createNominalHome(ctx context.Context) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - home := fs.wrap(ctx, "/") - _, err = fs.c.GetFileInfoByPath(ctx, "root", home) - if err == nil { // home already exists - return nil - } - - // TODO(labkode): abort on any error that is not found - if _, ok := err.(errtypes.IsNotFound); !ok { - return errors.Wrap(err, "eos: error verifying if user home directory exists") - } - - // TODO(labkode): only trigger creation on not found, copy from CERNBox logic. - err = fs.c.CreateDir(ctx, "root", home) - if err != nil { - // EOS will return success on mkdir over an existing directory. - return errors.Wrap(err, "eos: error creating dir") - } - err = fs.c.Chown(ctx, "root", u.Username, home) - if err != nil { - return errors.Wrap(err, "eos: error chowning directory") - } - - err = fs.c.Chmod(ctx, "root", "770", home) - if err != nil { - return errors.Wrap(err, "eos: error chmoding directory") - } - - attrs := []*eosclientgrpc.Attribute{ - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "mask", - Val: "700", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "allow.oc.sync", - Val: "1", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "mtime.propagation", - Val: "1", - }, - &eosclientgrpc.Attribute{ - Type: eosclientgrpc.SystemAttr, - Key: "forced.atomic", - Val: "1", - }, - } - - for _, attr := range attrs { - err = fs.c.SetAttr(ctx, "root", attr, true, home) - if err != nil { - return errors.Wrap(err, "eos: error setting attribute") - } - - } - return nil -} - -func (fs *eosfs) CreateHome(ctx context.Context) error { - if !fs.conf.EnableHome { - return errtypes.NotSupported("eos: create home not supported") - } - - if err := fs.createNominalHome(ctx); err != nil { - return errors.Wrap(err, "eos: error creating nominal home") - } - - if err := fs.createShadowHome(ctx); err != nil { - return errors.Wrap(err, "eos: error creating shadow home") - } - - return nil -} - -func (fs *eosfs) CreateDir(ctx context.Context, p string) error { - log := appctx.GetLogger(ctx) - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - log.Info().Msgf("eos: createdir: path=%s", p) - - if fs.isShareFolder(ctx, p) { - return errtypes.PermissionDenied("eos: cannot create folder under the share folder") - } - - fn := fs.wrap(ctx, p) - return fs.c.CreateDir(ctx, u.Username, fn) -} - -func (fs *eosfs) isShareFolder(ctx context.Context, p string) bool { - return strings.HasPrefix(p, fs.conf.ShareFolder) -} - -func (fs *eosfs) isShareFolderRoot(ctx context.Context, p string) bool { - return path.Clean(p) == fs.conf.ShareFolder -} - -func (fs *eosfs) isShareFolderChild(ctx context.Context, p string) bool { - p = path.Clean(p) - vals := strings.Split(p, fs.conf.ShareFolder+"/") - return len(vals) > 1 && vals[1] != "" -} - -func (fs *eosfs) CreateReference(ctx context.Context, p string, targetURI *url.URL) error { - // TODO(labkode): for the time being we only allow to create references - // on the virtual share folder to not pollute the nominal user tree. - - if !fs.isShareFolder(ctx, p) { - return errtypes.PermissionDenied("eos: cannot create references outside the share folder: share_folder=" + fs.conf.ShareFolder + " path=" + p) - } - - fn := fs.wrapShadow(ctx, p) - - // TODO(labkode): with grpc we can create a file touching with xattrs. - // Current mechanism is: touch to hidden dir, set xattr, rename. - dir, base := path.Split(fn) - tmp := path.Join(dir, fmt.Sprintf(".sys.reva#.%s", base)) - if err := fs.c.CreateDir(ctx, "root", tmp); err != nil { - err = errors.Wrapf(err, "eos: error creating temporary ref file") - return err - } - - // set xattr on ref - attr := &eosclientgrpc.Attribute{ - Type: eosclientgrpc.UserAttr, - Key: refTargetAttrKey, - Val: targetURI.String(), - } - - if err := fs.c.SetAttr(ctx, "root", attr, false, tmp); err != nil { - err = errors.Wrapf(err, "eos: error setting reva.ref attr on file: %q", tmp) - return err - } - - // rename to have the file visible in user space. - if err := fs.c.Rename(ctx, "root", tmp, fn); err != nil { - err = errors.Wrapf(err, "eos: error renaming from: %q to %q", tmp, fn) - return err - } - - return nil -} - -func (fs *eosfs) Delete(ctx context.Context, ref *provider.Reference) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return fs.deleteShadow(ctx, p) - } - - fn := fs.wrap(ctx, p) - - return fs.c.Remove(ctx, u.Username, fn) -} - -func (fs *eosfs) deleteShadow(ctx context.Context, p string) error { - if fs.isShareFolderRoot(ctx, p) { - return errtypes.PermissionDenied("eos: cannot delete the virtual share folder") - } - - if fs.isShareFolderChild(ctx, p) { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - fn := fs.wrapShadow(ctx, p) - return fs.c.Remove(ctx, u.Username, fn) - } - - panic("eos: shadow delete of share folder that is neither root nor child. path=" + p) -} - -func (fs *eosfs) Move(ctx context.Context, oldRef, newRef *provider.Reference) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - oldPath, err := fs.resolve(ctx, u, oldRef) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - newPath, err := fs.resolve(ctx, u, newRef) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, oldPath) || fs.isShareFolder(ctx, newPath) { - return fs.moveShadow(ctx, oldPath, newPath) - } - - oldFn := fs.wrap(ctx, oldPath) - newFn := fs.wrap(ctx, newPath) - return fs.c.Rename(ctx, u.Username, oldFn, newFn) -} - -func (fs *eosfs) moveShadow(ctx context.Context, oldPath, newPath string) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - if fs.isShareFolderRoot(ctx, oldPath) || fs.isShareFolderRoot(ctx, newPath) { - return errtypes.PermissionDenied("eos: cannot move/rename the virtual share folder") - } - - // only rename of the reference is allowed, hence having the same basedir - bold, _ := path.Split(oldPath) - bnew, _ := path.Split(newPath) - - if bold != bnew { - return errtypes.PermissionDenied("eos: cannot move references under the virtual share folder") - } - - oldfn := fs.wrapShadow(ctx, oldPath) - newfn := fs.wrapShadow(ctx, newPath) - return fs.c.Rename(ctx, u.Username, oldfn, newfn) -} - -func (fs *eosfs) Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return nil, errtypes.PermissionDenied("eos: cannot download under the virtual share folder") - } - - fn := fs.wrap(ctx, p) - - return fs.c.Read(ctx, u.Username, fn) -} - -func (fs *eosfs) Upload(ctx context.Context, ref *provider.Reference, r io.ReadCloser) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return errtypes.PermissionDenied("eos: cannot download under the virtual share folder") - } - - fn := fs.wrap(ctx, p) - - return fs.c.Write(ctx, u.Username, fn, r) -} - -func (fs *eosfs) ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return nil, errtypes.PermissionDenied("eos: cannot list revisions under the virtual share folder") - } - - fn := fs.wrap(ctx, p) - - eosRevisions, err := fs.c.ListVersions(ctx, u.Username, fn) - if err != nil { - return nil, errors.Wrap(err, "eos: error listing versions") - } - revisions := []*provider.FileVersion{} - for _, eosRev := range eosRevisions { - rev := fs.convertToRevision(ctx, eosRev) - revisions = append(revisions, rev) - } - return revisions, nil -} - -func (fs *eosfs) DownloadRevision(ctx context.Context, ref *provider.Reference, revisionKey string) (io.ReadCloser, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return nil, errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return nil, errtypes.PermissionDenied("eos: cannot download revision under the virtual share folder") - } - - fn := fs.wrap(ctx, p) - - fn = fs.wrap(ctx, fn) - return fs.c.ReadVersion(ctx, u.Username, fn, revisionKey) -} - -func (fs *eosfs) RestoreRevision(ctx context.Context, ref *provider.Reference, revisionKey string) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - - p, err := fs.resolve(ctx, u, ref) - if err != nil { - return errors.Wrap(err, "eos: error resolving reference") - } - - if fs.isShareFolder(ctx, p) { - return errtypes.PermissionDenied("eos: cannot restore revision under the virtual share folder") - } - - fn := fs.wrap(ctx, p) - - return fs.c.RollbackToVersion(ctx, u.Username, fn, revisionKey) -} - -func (fs *eosfs) PurgeRecycleItem(ctx context.Context, key string) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "storage_eos: no user in ctx") - } - return fs.c.RestoreDeletedEntry(ctx, u.Username, key) -} - -func (fs *eosfs) EmptyRecycle(ctx context.Context) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - return fs.c.PurgeDeletedEntries(ctx, u.Username) -} - -func (fs *eosfs) ListRecycle(ctx context.Context) ([]*provider.RecycleItem, error) { - u, err := getUser(ctx) - if err != nil { - return nil, errors.Wrap(err, "eos: no user in ctx") - } - eosDeletedEntries, err := fs.c.ListDeletedEntries(ctx, u.Username) - if err != nil { - return nil, errors.Wrap(err, "eos: error listing deleted entries") - } - recycleEntries := []*provider.RecycleItem{} - for _, entry := range eosDeletedEntries { - if !fs.conf.ShowHiddenSysFiles { - base := path.Base(entry.RestorePath) - if hiddenReg.MatchString(base) { - continue - } - - } - recycleItem := fs.convertToRecycleItem(ctx, entry) - recycleEntries = append(recycleEntries, recycleItem) - } - return recycleEntries, nil -} - -func (fs *eosfs) RestoreRecycleItem(ctx context.Context, key string) error { - u, err := getUser(ctx) - if err != nil { - return errors.Wrap(err, "eos: no user in ctx") - } - return fs.c.RestoreDeletedEntry(ctx, u.Username, key) -} - -func (fs *eosfs) convertToRecycleItem(ctx context.Context, eosDeletedItem *eosclientgrpc.DeletedEntry) *provider.RecycleItem { - path := fs.unwrap(ctx, eosDeletedItem.RestorePath) - recycleItem := &provider.RecycleItem{ - Path: path, - Key: eosDeletedItem.RestoreKey, - Size: eosDeletedItem.Size, - DeletionTime: &types.Timestamp{Seconds: eosDeletedItem.DeletionMTime / 1000}, // TODO(labkode): check if eos time is millis or nanos - } - if eosDeletedItem.IsDir { - recycleItem.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER - } else { - // TODO(labkode): if eos returns more types oin the future we need to map them. - recycleItem.Type = provider.ResourceType_RESOURCE_TYPE_FILE - } - return recycleItem -} - -func (fs *eosfs) convertToRevision(ctx context.Context, eosFileInfo *eosclientgrpc.FileInfo) *provider.FileVersion { - md := fs.convertToResourceInfo(ctx, eosFileInfo) - revision := &provider.FileVersion{ - Key: path.Base(md.Path), - Size: md.Size, - Mtime: md.Mtime.Seconds, // TODO do we need nanos here? - } - return revision -} - -func (fs *eosfs) convertToResourceInfo(ctx context.Context, eosFileInfo *eosclientgrpc.FileInfo) *provider.ResourceInfo { - return fs.convert(ctx, eosFileInfo) -} - -func (fs *eosfs) convertToFileReference(ctx context.Context, eosFileInfo *eosclientgrpc.FileInfo) *provider.ResourceInfo { - info := fs.convert(ctx, eosFileInfo) - info.Type = provider.ResourceType_RESOURCE_TYPE_REFERENCE - val, ok := eosFileInfo.Attrs["user.reva.target"] - if !ok || val == "" { - panic("eos: reference does not contain target: target=" + val + " file=" + eosFileInfo.File) - } - info.Target = val - return info -} - -func (fs *eosfs) convert(ctx context.Context, eosFileInfo *eosclientgrpc.FileInfo) *provider.ResourceInfo { - path := fs.unwrap(ctx, eosFileInfo.File) - - size := eosFileInfo.Size - if eosFileInfo.IsDir { - size = eosFileInfo.TreeSize - } - - username, err := getUsername(eosFileInfo.UID) - if err != nil { - log := appctx.GetLogger(ctx) - log.Warn().Uint64("uid", eosFileInfo.UID).Msg("could not lookup userid, leaving empty") - username = "" // TODO(labkode): should we abort here? - } - - info := &provider.ResourceInfo{ - Id: &provider.ResourceId{OpaqueId: fmt.Sprintf("%d", eosFileInfo.Inode)}, - Path: path, - Owner: &userpb.UserId{OpaqueId: username}, - Etag: fmt.Sprintf("\"%s\"", strings.Trim(eosFileInfo.ETag, "\"")), - MimeType: mime.Detect(eosFileInfo.IsDir, path), - Size: size, - PermissionSet: &provider.ResourcePermissions{ListContainer: true, CreateContainer: true}, - Mtime: &types.Timestamp{ - Seconds: eosFileInfo.MTimeSec, - Nanos: eosFileInfo.MTimeNanos, - }, - Opaque: &types.Opaque{ - Map: map[string]*types.OpaqueEntry{ - "eosgrpc": &types.OpaqueEntry{ - Decoder: "json", - Value: fs.getEosMetadata(eosFileInfo), - }, - }, - }, - } - - info.Type = getResourceType(eosFileInfo.IsDir) - return info -} - -func getResourceType(isDir bool) provider.ResourceType { - if isDir { - return provider.ResourceType_RESOURCE_TYPE_CONTAINER - } - return provider.ResourceType_RESOURCE_TYPE_FILE -} - -func getUsername(uid uint64) (string, error) { - s := strconv.FormatUint(uid, 10) - user, err := gouser.LookupId(s) - if err != nil { - return "", err - } - return user.Username, nil -} - -type eosSysMetadata struct { - TreeSize uint64 `json:"tree_size"` - TreeCount uint64 `json:"tree_count"` - File string `json:"file"` - Instance string `json:"instance"` -} - -func (fs *eosfs) getEosMetadata(finfo *eosclientgrpc.FileInfo) []byte { - sys := &eosSysMetadata{ - File: finfo.File, - Instance: finfo.Instance, - } - - if finfo.IsDir { - sys.TreeCount = finfo.TreeCount - sys.TreeSize = finfo.TreeSize - } - - v, _ := json.Marshal(sys) - return v -} - -/* - Merge shadow on requests for /home ? - - No - GetHome(ctx context.Context) (string, error) - No -CreateHome(ctx context.Context) error - No - CreateDir(ctx context.Context, fn string) error - No -Delete(ctx context.Context, ref *provider.Reference) error - No -Move(ctx context.Context, oldRef, newRef *provider.Reference) error - No -GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string) (*provider.ResourceInfo, error) - Yes -ListFolder(ctx context.Context, ref *provider.Reference) ([]*provider.ResourceInfo, error) - No -Upload(ctx context.Context, ref *provider.Reference, r io.ReadCloser) error - No -Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error) - No -ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error) - No -DownloadRevision(ctx context.Context, ref *provider.Reference, key string) (io.ReadCloser, error) - No -RestoreRevision(ctx context.Context, ref *provider.Reference, key string) error - No ListRecycle(ctx context.Context) ([]*provider.RecycleItem, error) - No RestoreRecycleItem(ctx context.Context, key string) error - No PurgeRecycleItem(ctx context.Context, key string) error - No EmptyRecycle(ctx context.Context) error - ? GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error) - No AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error) - No GetQuota(ctx context.Context) (int, int, error) - No CreateReference(ctx context.Context, path string, targetURI *url.URL) error - No Shutdown(ctx context.Context) error - No SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error - No UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error -*/ - -/* - Merge shadow on requests for /home/MyShares ? - - No - GetHome(ctx context.Context) (string, error) - No -CreateHome(ctx context.Context) error - No - CreateDir(ctx context.Context, fn string) error - Maybe -Delete(ctx context.Context, ref *provider.Reference) error - No -Move(ctx context.Context, oldRef, newRef *provider.Reference) error - Yes -GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string) (*provider.ResourceInfo, error) - Yes -ListFolder(ctx context.Context, ref *provider.Reference) ([]*provider.ResourceInfo, error) - No -Upload(ctx context.Context, ref *provider.Reference, r io.ReadCloser) error - No -Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error) - No -ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error) - No -DownloadRevision(ctx context.Context, ref *provider.Reference, key string) (io.ReadCloser, error) - No -RestoreRevision(ctx context.Context, ref *provider.Reference, key string) error - No ListRecycle(ctx context.Context) ([]*provider.RecycleItem, error) - No RestoreRecycleItem(ctx context.Context, key string) error - No PurgeRecycleItem(ctx context.Context, key string) error - No EmptyRecycle(ctx context.Context) error - ? GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error) - No AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error) - No GetQuota(ctx context.Context) (int, int, error) - No CreateReference(ctx context.Context, path string, targetURI *url.URL) error - No Shutdown(ctx context.Context) error - No SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error - No UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error -*/ - -/* - Merge shadow on requests for /home/MyShares/file-reference ? - - No - GetHome(ctx context.Context) (string, error) - No -CreateHome(ctx context.Context) error - No - CreateDir(ctx context.Context, fn string) error - Maybe -Delete(ctx context.Context, ref *provider.Reference) error - Yes -Move(ctx context.Context, oldRef, newRef *provider.Reference) error - Yes -GetMD(ctx context.Context, ref *provider.Reference, mdKeys []string) (*provider.ResourceInfo, error) - No -ListFolder(ctx context.Context, ref *provider.Reference) ([]*provider.ResourceInfo, error) - No -Upload(ctx context.Context, ref *provider.Reference, r io.ReadCloser) error - No -Download(ctx context.Context, ref *provider.Reference) (io.ReadCloser, error) - No -ListRevisions(ctx context.Context, ref *provider.Reference) ([]*provider.FileVersion, error) - No -DownloadRevision(ctx context.Context, ref *provider.Reference, key string) (io.ReadCloser, error) - No -RestoreRevision(ctx context.Context, ref *provider.Reference, key string) error - No ListRecycle(ctx context.Context) ([]*provider.RecycleItem, error) - No RestoreRecycleItem(ctx context.Context, key string) error - No PurgeRecycleItem(ctx context.Context, key string) error - No EmptyRecycle(ctx context.Context) error - ? GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error) - No AddGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No RemoveGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No UpdateGrant(ctx context.Context, ref *provider.Reference, g *provider.Grant) error - No ListGrants(ctx context.Context, ref *provider.Reference) ([]*provider.Grant, error) - No GetQuota(ctx context.Context) (int, int, error) - No CreateReference(ctx context.Context, path string, targetURI *url.URL) error - No Shutdown(ctx context.Context) error - Maybe SetArbitraryMetadata(ctx context.Context, ref *provider.Reference, md *provider.ArbitraryMetadata) error - Maybe UnsetArbitraryMetadata(ctx context.Context, ref *provider.Reference, keys []string) error -*/ diff --git a/pkg/storage/fs/eosgrpchome/eosgrpchome.go b/pkg/storage/fs/eosgrpchome/eosgrpchome.go new file mode 100644 index 0000000000..79cc953b77 --- /dev/null +++ b/pkg/storage/fs/eosgrpchome/eosgrpchome.go @@ -0,0 +1,58 @@ +// Copyright 2018-2020 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +package eosgrpchome + +import ( + "github.com/cs3org/reva/pkg/storage" + "github.com/cs3org/reva/pkg/storage/fs/registry" + "github.com/cs3org/reva/pkg/storage/utils/eosfs" + "github.com/mitchellh/mapstructure" + "github.com/pkg/errors" +) + +func init() { + registry.Register("eosgrpchome", New) +} + +func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { + c := &eosfs.Config{} + if err := mapstructure.Decode(m, c); err != nil { + err = errors.Wrap(err, "error decoding conf") + return nil, err + } + + // default to version invariance if not configured + if _, ok := m["version_invariant"]; !ok { + c.VersionInvariant = true + } + + return c, nil +} + +// New returns a new implementation of the storage.FS interface that connects to EOS. +func New(m map[string]interface{}) (storage.FS, error) { + c, err := parseConfig(m) + if err != nil { + return nil, err + } + c.UseGRPC = true + c.EnableHome = true + + return eosfs.NewEOSFS(c) +} diff --git a/pkg/storage/fs/eoshome/eoshome.go b/pkg/storage/fs/eoshome/eoshome.go index b72f184b77..717d5ae3ad 100644 --- a/pkg/storage/fs/eoshome/eoshome.go +++ b/pkg/storage/fs/eoshome/eoshome.go @@ -19,9 +19,6 @@ package eoshome import ( - "bytes" - "encoding/gob" - "github.com/cs3org/reva/pkg/storage" "github.com/cs3org/reva/pkg/storage/fs/registry" "github.com/cs3org/reva/pkg/storage/utils/eosfs" @@ -33,79 +30,8 @@ func init() { registry.Register("eoshome", New) } -type config struct { - // Namespace for metadata operations - Namespace string `mapstructure:"namespace" docs:"/"` - - // ShadowNamespace for storing shadow data - ShadowNamespace string `mapstructure:"shadow_namespace" docs:"/.shadow"` - - // UploadsNamespace for storing upload data - UploadsNamespace string `mapstructure:"uploads_namespace" docs:"/.uploads"` - - // ShareFolder defines the name of the folder in the - // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares - ShareFolder string `mapstructure:"share_folder" docs:"/MyShares"` - - // Location of the eos binary. - // Default is /usr/bin/eos. - EosBinary string `mapstructure:"eos_binary" docs:"/usr/bin/eos"` - - // Location of the xrdcopy binary. - // Default is /usr/bin/xrdcopy. - XrdcopyBinary string `mapstructure:"xrdcopy_binary" docs:"/usr/bin/xrdcopy"` - - // URL of the Master EOS MGM. - // Default is root://eos-example.org - MasterURL string `mapstructure:"master_url" docs:"root://eos-example.org"` - - // URL of the Slave EOS MGM. - // Default is root://eos-example.org - SlaveURL string `mapstructure:"slave_url" docs:"root://eos-example.org"` - - // Location on the local fs where to store reads. - // Defaults to os.TempDir() - CacheDirectory string `mapstructure:"cache_directory" docs:"/var/tmp/"` - - // SecProtocol specifies the xrootd security protocol to use between the server and EOS. - SecProtocol string `mapstructure:"sec_protocol" docs:"-"` - - // Keytab specifies the location of the keytab to use to authenticate to EOS. - Keytab string `mapstructure:"keytab" docs:"-"` - - // SingleUsername is the username to use when SingleUserMode is enabled - SingleUsername string `mapstructure:"single_username" docs:"-"` - - // UserLayout wraps the internal path with user information. - // Example: if conf.Namespace is /eos/user and received path is /docs - // and the UserLayout is {{.Username}} the internal path will be: - // /eos/user//docs - UserLayout string `mapstructure:"user_layout" docs:"{{.Username}}"` - - // Enables logging of the commands executed - // Defaults to false - EnableLogging bool `mapstructure:"enable_logging" docs:"false"` - - // ShowHiddenSysFiles shows internal EOS files like - // .sys.v# and .sys.a# files. - ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files" docs:"false"` - - // ForceSingleUserMode will force connections to EOS to use SingleUsername - ForceSingleUserMode bool `mapstructure:"force_single_user_mode" docs:"false"` - - // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. - UseKeytab bool `mapstructure:"use_keytab" docs:"false"` - - // Whether to maintain the same inode across various versions of a file. - // Requires extra metadata operations if set to true - VersionInvariant bool `mapstructure:"version_invariant" docs:"true"` - - // GatewaySvc stores the endpoint at which the GRPC gateway is exposed. - GatewaySvc string `mapstructure:"gatewaysvc" docs:"0.0.0.0:19000"` -} - -func parseConfig(m map[string]interface{}) (*config, error) { - c := &config{} +func parseConfig(m map[string]interface{}) (*eosfs.Config, error) { + c := &eosfs.Config{} if err := mapstructure.Decode(m, c); err != nil { err = errors.Wrap(err, "error decoding conf") return nil, err @@ -125,18 +51,7 @@ func New(m map[string]interface{}) (storage.FS, error) { if err != nil { return nil, err } + c.EnableHome = true - var buf bytes.Buffer - err = gob.NewEncoder(&buf).Encode(&c) - if err != nil { - return nil, err - } - var conf eosfs.Config - err = gob.NewDecoder(&buf).Decode(&conf) - if err != nil { - return nil, err - } - conf.EnableHome = true - - return eosfs.NewEOSFS(&conf) + return eosfs.NewEOSFS(c) } diff --git a/pkg/storage/fs/loader/loader.go b/pkg/storage/fs/loader/loader.go index 744265bc8f..0077ee5c59 100644 --- a/pkg/storage/fs/loader/loader.go +++ b/pkg/storage/fs/loader/loader.go @@ -22,6 +22,7 @@ import ( // Load core storage filesystem backends. _ "github.com/cs3org/reva/pkg/storage/fs/eos" _ "github.com/cs3org/reva/pkg/storage/fs/eosgrpc" + _ "github.com/cs3org/reva/pkg/storage/fs/eosgrpchome" _ "github.com/cs3org/reva/pkg/storage/fs/eoshome" _ "github.com/cs3org/reva/pkg/storage/fs/local" _ "github.com/cs3org/reva/pkg/storage/fs/localhome" diff --git a/pkg/storage/utils/eosfs/config.go b/pkg/storage/utils/eosfs/config.go new file mode 100644 index 0000000000..f06e35cf25 --- /dev/null +++ b/pkg/storage/utils/eosfs/config.go @@ -0,0 +1,105 @@ +// Copyright 2018-2020 CERN +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// In applying this license, CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +package eosfs + +// Config holds the configuration details for the EOS fs. +type Config struct { + // Namespace for metadata operations + Namespace string `mapstructure:"namespace"` + + // ShadowNamespace for storing shadow data + ShadowNamespace string `mapstructure:"shadow_namespace"` + + // UploadsNamespace for storing upload data + UploadsNamespace string `mapstructure:"uploads_namespace"` + + // ShareFolder defines the name of the folder in the + // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares + ShareFolder string `mapstructure:"share_folder"` + + // Location of the eos binary. + // Default is /usr/bin/eos. + EosBinary string `mapstructure:"eos_binary"` + + // Location of the xrdcopy binary. + // Default is /usr/bin/xrdcopy. + XrdcopyBinary string `mapstructure:"xrdcopy_binary"` + + // URL of the Master EOS MGM. + // Default is root://eos-example.org + MasterURL string `mapstructure:"master_url"` + + // URL of the Slave EOS MGM. + // Default is root://eos-example.org + SlaveURL string `mapstructure:"slave_url"` + + // Location on the local fs where to store reads. + // Defaults to os.TempDir() + CacheDirectory string `mapstructure:"cache_directory"` + + // SecProtocol specifies the xrootd security protocol to use between the server and EOS. + SecProtocol string `mapstructure:"sec_protocol"` + + // Keytab specifies the location of the keytab to use to authenticate to EOS. + Keytab string `mapstructure:"keytab"` + + // SingleUsername is the username to use when SingleUserMode is enabled + SingleUsername string `mapstructure:"single_username"` + + // UserLayout wraps the internal path with user information. + // Example: if conf.Namespace is /eos/user and received path is /docs + // and the UserLayout is {{.Username}} the internal path will be: + // /eos/user//docs + UserLayout string `mapstructure:"user_layout"` + + // Enables logging of the commands executed + // Defaults to false + EnableLogging bool `mapstructure:"enable_logging"` + + // ShowHiddenSysFiles shows internal EOS files like + // .sys.v# and .sys.a# files. + ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files"` + + // ForceSingleUserMode will force connections to EOS to use SingleUsername + ForceSingleUserMode bool `mapstructure:"force_single_user_mode"` + + // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. + UseKeytab bool `mapstructure:"use_keytab"` + + // EnableHome enables the creation of home directories. + EnableHome bool `mapstructure:"enable_home"` + + // Whether to maintain the same inode across various versions of a file. + // Requires extra metadata operations if set to true + VersionInvariant bool `mapstructure:"version_invariant"` + + // UseGRPC controls whether we spawn eosclient processes or use GRPC to connect to EOS. + UseGRPC bool `mapstructure:"use_grpc"` + + // GatewaySvc stores the endpoint at which the GRPC gateway is exposed. + GatewaySvc string `mapstructure:"gatewaysvc"` + + // GRPCAuthkey is the key that authorizes this client to connect to the GRPC service + // It's unclear whether this will be the final solution + GRPCAuthkey string `mapstructure:"grpc_auth_key"` + + // URI of the EOS MGM grpc server + // Default is empty + GrpcURI string `mapstructure:"master_grpc_uri"` +} diff --git a/pkg/storage/utils/eosfs/eosfs.go b/pkg/storage/utils/eosfs/eosfs.go index 6f47e3a93b..7f1b02482e 100644 --- a/pkg/storage/utils/eosfs/eosfs.go +++ b/pkg/storage/utils/eosfs/eosfs.go @@ -37,6 +37,8 @@ import ( types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/cs3org/reva/pkg/appctx" "github.com/cs3org/reva/pkg/eosclient" + "github.com/cs3org/reva/pkg/eosclient/eosbinary" + "github.com/cs3org/reva/pkg/eosclient/eosgrpc" "github.com/cs3org/reva/pkg/errtypes" "github.com/cs3org/reva/pkg/mime" "github.com/cs3org/reva/pkg/rgrpc/todo/pool" @@ -54,82 +56,14 @@ const ( refTargetAttrKey = "reva.target" ) -var hiddenReg = regexp.MustCompile(`\.sys\..#.`) - -// Config holds the configuration details for the EOS fs. -type Config struct { - // Namespace for metadata operations - Namespace string `mapstructure:"namespace"` - - // ShadowNamespace for storing shadow data - ShadowNamespace string `mapstructure:"shadow_namespace"` - - // UploadsNamespace for storing upload data - UploadsNamespace string `mapstructure:"uploads_namespace"` - - // ShareFolder defines the name of the folder in the - // shadowed namespace. Ex: /eos/user/.shadow/h/hugo/MyShares - ShareFolder string `mapstructure:"share_folder"` - - // Location of the eos binary. - // Default is /usr/bin/eos. - EosBinary string `mapstructure:"eos_binary"` - - // Location of the xrdcopy binary. - // Default is /usr/bin/xrdcopy. - XrdcopyBinary string `mapstructure:"xrdcopy_binary"` - - // URL of the Master EOS MGM. - // Default is root://eos-example.org - MasterURL string `mapstructure:"master_url"` - - // URL of the Slave EOS MGM. - // Default is root://eos-example.org - SlaveURL string `mapstructure:"slave_url"` - - // Location on the local fs where to store reads. - // Defaults to os.TempDir() - CacheDirectory string `mapstructure:"cache_directory"` - - // SecProtocol specifies the xrootd security protocol to use between the server and EOS. - SecProtocol string `mapstructure:"sec_protocol"` - - // Keytab specifies the location of the keytab to use to authenticate to EOS. - Keytab string `mapstructure:"keytab"` - - // SingleUsername is the username to use when SingleUserMode is enabled - SingleUsername string `mapstructure:"single_username"` - - // UserLayout wraps the internal path with user information. - // Example: if conf.Namespace is /eos/user and received path is /docs - // and the UserLayout is {{.Username}} the internal path will be: - // /eos/user//docs - UserLayout string `mapstructure:"user_layout"` - - // Enables logging of the commands executed - // Defaults to false - EnableLogging bool `mapstructure:"enable_logging"` - - // ShowHiddenSysFiles shows internal EOS files like - // .sys.v# and .sys.a# files. - ShowHiddenSysFiles bool `mapstructure:"show_hidden_sys_files"` - - // ForceSingleUserMode will force connections to EOS to use SingleUsername - ForceSingleUserMode bool `mapstructure:"force_single_user_mode"` - - // UseKeyTabAuth changes will authenticate requests by using an EOS keytab. - UseKeytab bool `mapstructure:"use_keytab"` - - // EnableHome enables the creation of home directories. - EnableHome bool `mapstructure:"enable_home"` - - // Whether to maintain the same inode across various versions of a file. - // Requires extra metadata operations if set to true - VersionInvariant bool `mapstructure:"version_invariant"` +const ( + // SystemAttr is the system extended attribute. + SystemAttr eosclient.AttrType = iota + // UserAttr is the user extended attribute. + UserAttr +) - // GatewaySvc stores the endpoint at which the GRPC gateway is exposed. - GatewaySvc string `mapstructure:"gatewaysvc"` -} +var hiddenReg = regexp.MustCompile(`\.sys\..#.`) func (c *Config) init() { c.Namespace = path.Clean(c.Namespace) @@ -175,7 +109,7 @@ func (c *Config) init() { } type eosfs struct { - c *eosclient.Client + c eosclient.EOSClient conf *Config chunkHandler *chunking.ChunkHandler singleUserUID string @@ -183,8 +117,7 @@ type eosfs struct { userIDCache sync.Map } -// NewEOSFS returns a storage.FS interface implementation that connects to an -// EOS instance +// NewEOSFS returns a storage.FS interface implementation that connects to an EOS instance func NewEOSFS(c *Config) (storage.FS, error) { c.init() @@ -196,21 +129,38 @@ func NewEOSFS(c *Config) (storage.FS, error) { } } - eosClientOpts := &eosclient.Options{ - XrdcopyBinary: c.XrdcopyBinary, - URL: c.MasterURL, - EosBinary: c.EosBinary, - CacheDirectory: c.CacheDirectory, - ForceSingleUserMode: c.ForceSingleUserMode, - SingleUsername: c.SingleUsername, - UseKeytab: c.UseKeytab, - Keytab: c.Keytab, - SecProtocol: c.SecProtocol, - VersionInvariant: c.VersionInvariant, + var eosClient eosclient.EOSClient + if c.UseGRPC { + eosClientOpts := &eosgrpc.Options{ + XrdcopyBinary: c.XrdcopyBinary, + URL: c.MasterURL, + GrpcURI: c.GrpcURI, + CacheDirectory: c.CacheDirectory, + ForceSingleUserMode: c.ForceSingleUserMode, + SingleUsername: c.SingleUsername, + UseKeytab: c.UseKeytab, + Keytab: c.Keytab, + Authkey: c.GRPCAuthkey, + SecProtocol: c.SecProtocol, + VersionInvariant: c.VersionInvariant, + } + eosClient = eosgrpc.New(eosClientOpts) + } else { + eosClientOpts := &eosbinary.Options{ + XrdcopyBinary: c.XrdcopyBinary, + URL: c.MasterURL, + EosBinary: c.EosBinary, + CacheDirectory: c.CacheDirectory, + ForceSingleUserMode: c.ForceSingleUserMode, + SingleUsername: c.SingleUsername, + UseKeytab: c.UseKeytab, + Keytab: c.Keytab, + SecProtocol: c.SecProtocol, + VersionInvariant: c.VersionInvariant, + } + eosClient = eosbinary.New(eosClientOpts) } - eosClient := eosclient.New(eosClientOpts) - eosfs := &eosfs{ c: eosClient, conf: c, @@ -646,8 +596,6 @@ func (fs *eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys return nil, errors.Wrap(err, "eos: error resolving reference") } - log.Debug().Msg("internal: " + p) - // if path is home we need to add in the response any shadow folder in the shadow homedirectory. if fs.conf.EnableHome { log.Debug().Msg("home enabled") @@ -656,7 +604,6 @@ func (fs *eosfs) ListFolder(ctx context.Context, ref *provider.Reference, mdKeys } } - log.Debug().Msg("list with nominal home") return fs.listWithNominalHome(ctx, p) } @@ -699,14 +646,11 @@ func (fs *eosfs) listWithNominalHome(ctx context.Context, p string) (finfos []*p } func (fs *eosfs) listWithHome(ctx context.Context, home, p string) ([]*provider.ResourceInfo, error) { - log := appctx.GetLogger(ctx) if p == home { - log.Debug().Msg("listing home") return fs.listHome(ctx, home) } if fs.isShareFolderRoot(ctx, p) { - log.Debug().Msg("listing share root folder") return fs.listShareFolderRoot(ctx, p) } @@ -715,7 +659,6 @@ func (fs *eosfs) listWithHome(ctx context.Context, home, p string) ([]*provider. } // path points to a resource in the nominal home - log.Debug().Msg("listing nominal home") return fs.listWithNominalHome(ctx, p) } @@ -848,22 +791,21 @@ func (fs *eosfs) createShadowHome(ctx context.Context) error { return nil } _, err = fs.c.GetFileInfoByPath(ctx, uid, gid, home) - if err == nil { // home already exists - return nil - } + if err != nil { // home already exists + // TODO(labkode): abort on any error that is not found + if _, ok := err.(errtypes.IsNotFound); !ok { + return errors.Wrap(err, "eos: error verifying if user home directory exists") + } - // TODO(labkode): abort on any error that is not found - if _, ok := err.(errtypes.IsNotFound); !ok { - return errors.Wrap(err, "eos: error verifying if user home directory exists") + err = fs.createUserDir(ctx, u, home) + if err != nil { + return err + } } - err = fs.createUserDir(ctx, u, home) - if err != nil { - return err - } shadowFolders := []string{fs.conf.ShareFolder} for _, sf := range shadowFolders { - err = fs.createUserDir(ctx, u, path.Join(home, sf)) + err = fs.c.CreateDir(ctx, uid, gid, path.Join(home, sf)) if err != nil { return err } @@ -942,22 +884,22 @@ func (fs *eosfs) createUserDir(ctx context.Context, u *userpb.User, path string) attrs := []*eosclient.Attribute{ &eosclient.Attribute{ - Type: eosclient.SystemAttr, + Type: SystemAttr, Key: "mask", Val: "700", }, &eosclient.Attribute{ - Type: eosclient.SystemAttr, + Type: SystemAttr, Key: "allow.oc.sync", Val: "1", }, &eosclient.Attribute{ - Type: eosclient.SystemAttr, + Type: SystemAttr, Key: "mtime.propagation", Val: "1", }, &eosclient.Attribute{ - Type: eosclient.SystemAttr, + Type: SystemAttr, Key: "forced.atomic", Val: "1", }, @@ -1019,7 +961,7 @@ func (fs *eosfs) CreateReference(ctx context.Context, p string, targetURI *url.U // set xattr on ref attr := &eosclient.Attribute{ - Type: eosclient.UserAttr, + Type: UserAttr, Key: refTargetAttrKey, Val: targetURI.String(), } @@ -1083,7 +1025,7 @@ func (fs *eosfs) deleteShadow(ctx context.Context, p string) error { return fs.c.Remove(ctx, uid, gid, fn) } - panic("eos: shadow delete of share folder that is neither root nor child. path=" + p) + return errors.New("eos: shadow delete of share folder that is neither root nor child. path=" + p) } func (fs *eosfs) Move(ctx context.Context, oldRef, newRef *provider.Reference) error { @@ -1165,7 +1107,6 @@ func (fs *eosfs) Download(ctx context.Context, ref *provider.Reference) (io.Read } fn := fs.wrap(ctx, p) - return fs.c.Read(ctx, uid, gid, fn) } @@ -1507,6 +1448,17 @@ func (fs *eosfs) getRootUIDAndGID(ctx context.Context) (string, string, error) { return "0", "0", nil } +//func attrTypeToString(at eosclient.AttrType) string { +// switch at { +// case SystemAttr: +// return "sys" +// case UserAttr: +// return "user" +// default: +// return "invalid" +// } +//} + type eosSysMetadata struct { TreeSize uint64 `json:"tree_size"` TreeCount uint64 `json:"tree_count"`