github.com/cs3org/reva/v2@v2.27.7/pkg/rgrpc/todo/pool/client.go (about) 1 // Copyright 2018-2021 CERN 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 // 15 // In applying this license, CERN does not waive the privileges and immunities 16 // granted to it by virtue of its status as an Intergovernmental Organization 17 // or submit itself to any jurisdiction. 18 19 package pool 20 21 import ( 22 appprovider "github.com/cs3org/go-cs3apis/cs3/app/provider/v1beta1" 23 appregistry "github.com/cs3org/go-cs3apis/cs3/app/registry/v1beta1" 24 applicationauth "github.com/cs3org/go-cs3apis/cs3/auth/applications/v1beta1" 25 authprovider "github.com/cs3org/go-cs3apis/cs3/auth/provider/v1beta1" 26 authregistry "github.com/cs3org/go-cs3apis/cs3/auth/registry/v1beta1" 27 gateway "github.com/cs3org/go-cs3apis/cs3/gateway/v1beta1" 28 group "github.com/cs3org/go-cs3apis/cs3/identity/group/v1beta1" 29 user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" 30 ocmcore "github.com/cs3org/go-cs3apis/cs3/ocm/core/v1beta1" 31 invitepb "github.com/cs3org/go-cs3apis/cs3/ocm/invite/v1beta1" 32 ocmprovider "github.com/cs3org/go-cs3apis/cs3/ocm/provider/v1beta1" 33 permissions "github.com/cs3org/go-cs3apis/cs3/permissions/v1beta1" 34 preferences "github.com/cs3org/go-cs3apis/cs3/preferences/v1beta1" 35 collaboration "github.com/cs3org/go-cs3apis/cs3/sharing/collaboration/v1beta1" 36 link "github.com/cs3org/go-cs3apis/cs3/sharing/link/v1beta1" 37 ocm "github.com/cs3org/go-cs3apis/cs3/sharing/ocm/v1beta1" 38 storageprovider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" 39 storageregistry "github.com/cs3org/go-cs3apis/cs3/storage/registry/v1beta1" 40 datatx "github.com/cs3org/go-cs3apis/cs3/tx/v1beta1" 41 ) 42 43 // GetGatewayServiceClient returns a GatewayServiceClient. 44 func GetGatewayServiceClient(id string, opts ...Option) (gateway.GatewayAPIClient, error) { 45 selector, _ := GatewaySelector(id, opts...) 46 return selector.Next() 47 } 48 49 // GetUserProviderServiceClient returns a UserProviderServiceClient. 50 func GetUserProviderServiceClient(id string, opts ...Option) (user.UserAPIClient, error) { 51 selector, _ := IdentityUserSelector(id, opts...) 52 return selector.Next() 53 } 54 55 // GetGroupProviderServiceClient returns a GroupProviderServiceClient. 56 func GetGroupProviderServiceClient(id string, opts ...Option) (group.GroupAPIClient, error) { 57 selector, _ := IdentityGroupSelector(id, opts...) 58 return selector.Next() 59 } 60 61 // GetStorageProviderServiceClient returns a StorageProviderServiceClient. 62 func GetStorageProviderServiceClient(id string, opts ...Option) (storageprovider.ProviderAPIClient, error) { 63 selector, _ := StorageProviderSelector(id, opts...) 64 return selector.Next() 65 } 66 67 // GetSpacesProviderServiceClient returns a SpacesProviderServiceClient. 68 func GetSpacesProviderServiceClient(id string, opts ...Option) (storageprovider.SpacesAPIClient, error) { 69 selector, _ := SpacesProviderSelector(id, opts...) 70 return selector.Next() 71 } 72 73 // GetAuthRegistryServiceClient returns a new AuthRegistryServiceClient. 74 func GetAuthRegistryServiceClient(id string, opts ...Option) (authregistry.RegistryAPIClient, error) { 75 selector, _ := AuthRegistrySelector(id, opts...) 76 return selector.Next() 77 } 78 79 // GetAuthProviderServiceClient returns a new AuthProviderServiceClient. 80 func GetAuthProviderServiceClient(id string, opts ...Option) (authprovider.ProviderAPIClient, error) { 81 selector, _ := AuthProviderSelector(id, opts...) 82 return selector.Next() 83 } 84 85 // GetAppAuthProviderServiceClient returns a new AppAuthProviderServiceClient. 86 func GetAppAuthProviderServiceClient(id string, opts ...Option) (applicationauth.ApplicationsAPIClient, error) { 87 selector, _ := AuthApplicationSelector(id, opts...) 88 return selector.Next() 89 } 90 91 // GetUserShareProviderClient returns a new UserShareProviderClient. 92 func GetUserShareProviderClient(id string, opts ...Option) (collaboration.CollaborationAPIClient, error) { 93 selector, _ := SharingCollaborationSelector(id, opts...) 94 return selector.Next() 95 } 96 97 // GetOCMShareProviderClient returns a new OCMShareProviderClient. 98 func GetOCMShareProviderClient(id string, opts ...Option) (ocm.OcmAPIClient, error) { 99 selector, _ := SharingOCMSelector(id, opts...) 100 return selector.Next() 101 } 102 103 // GetOCMInviteManagerClient returns a new OCMInviteManagerClient. 104 func GetOCMInviteManagerClient(id string, opts ...Option) (invitepb.InviteAPIClient, error) { 105 selector, _ := OCMInviteSelector(id, opts...) 106 return selector.Next() 107 } 108 109 // GetPublicShareProviderClient returns a new PublicShareProviderClient. 110 func GetPublicShareProviderClient(id string, opts ...Option) (link.LinkAPIClient, error) { 111 selector, _ := SharingLinkSelector(id, opts...) 112 return selector.Next() 113 } 114 115 // GetPreferencesClient returns a new PreferencesClient. 116 func GetPreferencesClient(id string, opts ...Option) (preferences.PreferencesAPIClient, error) { 117 selector, _ := PreferencesSelector(id, opts...) 118 return selector.Next() 119 } 120 121 // GetPermissionsClient returns a new PermissionsClient. 122 func GetPermissionsClient(id string, opts ...Option) (permissions.PermissionsAPIClient, error) { 123 selector, _ := PermissionsSelector(id, opts...) 124 return selector.Next() 125 } 126 127 // GetAppRegistryClient returns a new AppRegistryClient. 128 func GetAppRegistryClient(id string, opts ...Option) (appregistry.RegistryAPIClient, error) { 129 selector, _ := AppRegistrySelector(id, opts...) 130 return selector.Next() 131 } 132 133 // GetAppProviderClient returns a new AppRegistryClient. 134 func GetAppProviderClient(id string, opts ...Option) (appprovider.ProviderAPIClient, error) { 135 selector, _ := AppProviderSelector(id, opts...) 136 return selector.Next() 137 } 138 139 // GetStorageRegistryClient returns a new StorageRegistryClient. 140 func GetStorageRegistryClient(id string, opts ...Option) (storageregistry.RegistryAPIClient, error) { 141 selector, _ := StorageRegistrySelector(id, opts...) 142 return selector.Next() 143 } 144 145 // GetOCMProviderAuthorizerClient returns a new OCMProviderAuthorizerClient. 146 func GetOCMProviderAuthorizerClient(id string, opts ...Option) (ocmprovider.ProviderAPIClient, error) { 147 selector, _ := OCMProviderSelector(id, opts...) 148 return selector.Next() 149 } 150 151 // GetOCMCoreClient returns a new OCMCoreClient. 152 func GetOCMCoreClient(id string, opts ...Option) (ocmcore.OcmCoreAPIClient, error) { 153 selector, _ := OCMCoreSelector(id, opts...) 154 return selector.Next() 155 } 156 157 // GetDataTxClient returns a new DataTxClient. 158 func GetDataTxClient(id string, opts ...Option) (datatx.TxAPIClient, error) { 159 selector, _ := TXSelector(id, opts...) 160 return selector.Next() 161 }