Add public theme
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m52s
Some checks failed
Build and Push Docker Image / build_and_push (push) Failing after 2m52s
This commit is contained in:
@@ -26,12 +26,12 @@ func NewMobilityAccountService(mobilityAccountsDial string) (*MobilityAccountSer
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetBeneficiaries() (accounts []storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetBeneficiaries(ctx context.Context) (accounts []storage.Account, err error) {
|
||||
accounts = []storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaries"},
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -43,12 +43,12 @@ func (s *ServicesHandler) GetBeneficiaries() (accounts []storage.Account, err er
|
||||
return
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetBeneficiariesMap() (accounts map[string]storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetBeneficiariesMap(ctx context.Context) (accounts map[string]storage.Account, err error) {
|
||||
accounts = map[string]storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: []string{"parcoursmob_beneficiaries"},
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -59,12 +59,12 @@ func (s *ServicesHandler) GetBeneficiariesMap() (accounts map[string]storage.Acc
|
||||
return
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetAccounts() (accounts []storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetAccounts(ctx context.Context) (accounts []storage.Account, err error) {
|
||||
accounts = []storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: []string{"parcoursmob"},
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -76,12 +76,12 @@ func (s *ServicesHandler) GetAccounts() (accounts []storage.Account, err error)
|
||||
return
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetAccountsInNamespace(namespace string) (accounts []storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetAccountsInNamespace(ctx context.Context, namespace string) (accounts []storage.Account, err error) {
|
||||
accounts = []storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: []string{namespace},
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -92,12 +92,12 @@ func (s *ServicesHandler) GetAccountsInNamespace(namespace string) (accounts []s
|
||||
|
||||
return
|
||||
}
|
||||
func (s *ServicesHandler) GetAccountsInNamespaceMap(namespace string) (accounts map[string]storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetAccountsInNamespaceMap(ctx context.Context, namespace string) (accounts map[string]storage.Account, err error) {
|
||||
accounts = map[string]storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: []string{namespace},
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -108,12 +108,12 @@ func (s *ServicesHandler) GetAccountsInNamespaceMap(namespace string) (accounts
|
||||
return
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetAccountsInNamespacesMap(namespaces []string) (accounts map[string]storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetAccountsInNamespacesMap(ctx context.Context, namespaces []string) (accounts map[string]storage.Account, err error) {
|
||||
accounts = map[string]storage.Account{}
|
||||
request := &mobilityaccounts.GetAccountsRequest{
|
||||
Namespaces: namespaces,
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccounts(ctx, request)
|
||||
|
||||
if err == nil {
|
||||
for _, v := range resp.Accounts {
|
||||
@@ -124,11 +124,11 @@ func (s *ServicesHandler) GetAccountsInNamespacesMap(namespaces []string) (accou
|
||||
return
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetAccount(id string) (account storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetAccount(ctx context.Context, id string) (account storage.Account, err error) {
|
||||
request := &mobilityaccounts.GetAccountRequest{
|
||||
Id: id,
|
||||
}
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccount(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccount(ctx, request)
|
||||
if err != nil {
|
||||
return storage.Account{}, err
|
||||
}
|
||||
@@ -136,7 +136,7 @@ func (s *ServicesHandler) GetAccount(id string) (account storage.Account, err er
|
||||
return resp.Account.ToStorageType(), nil
|
||||
}
|
||||
|
||||
func (s *ServicesHandler) GetBeneficiariesInGroup(group groupstorage.Group) (accounts []storage.Account, err error) {
|
||||
func (s *ServicesHandler) GetBeneficiariesInGroup(ctx context.Context, group groupstorage.Group) (accounts []storage.Account, err error) {
|
||||
accounts = []storage.Account{}
|
||||
|
||||
if len(group.Members) == 0 {
|
||||
@@ -147,7 +147,7 @@ func (s *ServicesHandler) GetBeneficiariesInGroup(group groupstorage.Group) (acc
|
||||
Accountids: group.Members,
|
||||
}
|
||||
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccountsBatch(context.TODO(), request)
|
||||
resp, err := s.GRPC.MobilityAccounts.GetAccountsBatch(ctx, request)
|
||||
if err != nil {
|
||||
return accounts, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user