Skip to content
Snippets Groups Projects
Commit 6ed32d8d authored by Valera Shaitorov's avatar Valera Shaitorov :alien:
Browse files

Добавлен Organizations

parent 28d80079
No related branches found
No related tags found
No related merge requests found
Showing with 844 additions and 0 deletions
// Code generated by mockery v2.7.4. DO NOT EDIT.
package mocks
import (
context "context"
organizations "git.perx.ru/perxis/perxis-go/pkg/organizations"
services "git.perx.ru/perxis/perxis-go/pkg/options"
mock "github.com/stretchr/testify/mock"
)
// Organizations is an autogenerated mock type for the Organizations type
type Organizations struct {
mock.Mock
}
// Create provides a mock function with given fields: ctx, org
func (_m *Organizations) Create(ctx context.Context, org *organizations.Organization) (*organizations.Organization, error) {
ret := _m.Called(ctx, org)
var r0 *organizations.Organization
if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) *organizations.Organization); ok {
r0 = rf(ctx, org)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*organizations.Organization)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *organizations.Organization) error); ok {
r1 = rf(ctx, org)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Delete provides a mock function with given fields: ctx, orgId
func (_m *Organizations) Delete(ctx context.Context, orgId string) error {
ret := _m.Called(ctx, orgId)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, string) error); ok {
r0 = rf(ctx, orgId)
} else {
r0 = ret.Error(0)
}
return r0
}
// Find provides a mock function with given fields: ctx, filter, opts
func (_m *Organizations) Find(ctx context.Context, filter *organizations.Filter, opts *services.FindOptions) ([]*organizations.Organization, int, error) {
ret := _m.Called(ctx, filter, opts)
var r0 []*organizations.Organization
if rf, ok := ret.Get(0).(func(context.Context, *organizations.Filter, *services.FindOptions) []*organizations.Organization); ok {
r0 = rf(ctx, filter, opts)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]*organizations.Organization)
}
}
var r1 int
if rf, ok := ret.Get(1).(func(context.Context, *organizations.Filter, *services.FindOptions) int); ok {
r1 = rf(ctx, filter, opts)
} else {
r1 = ret.Get(1).(int)
}
var r2 error
if rf, ok := ret.Get(2).(func(context.Context, *organizations.Filter, *services.FindOptions) error); ok {
r2 = rf(ctx, filter, opts)
} else {
r2 = ret.Error(2)
}
return r0, r1, r2
}
// Get provides a mock function with given fields: ctx, orgId
func (_m *Organizations) Get(ctx context.Context, orgId string) (*organizations.Organization, error) {
ret := _m.Called(ctx, orgId)
var r0 *organizations.Organization
if rf, ok := ret.Get(0).(func(context.Context, string) *organizations.Organization); ok {
r0 = rf(ctx, orgId)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*organizations.Organization)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, string) error); ok {
r1 = rf(ctx, orgId)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Update provides a mock function with given fields: ctx, org
func (_m *Organizations) Update(ctx context.Context, org *organizations.Organization) error {
ret := _m.Called(ctx, org)
var r0 error
if rf, ok := ret.Get(0).(func(context.Context, *organizations.Organization) error); ok {
r0 = rf(ctx, org)
} else {
r0 = ret.Error(0)
}
return r0
}
package organizations
type Organization struct {
ID string `bson:"_id"`
Name string `bson:"name"`
Description string `bson:"description"`
LogoURL string `bson:"logoUrl"`
OwnerID *string `bson:"-"`
}
func (o *Organization) SetOwnerID(s string) *Organization {
o.OwnerID = &s
return o
}
package organizations
import (
"context"
"git.perx.ru/perxis/perxis-go/pkg/options"
)
// @microgen grpc
// @protobuf git.perx.ru/perxis/perxis-go/proto/organizations
// @grpc-addr account.organizations.Organizations
type Organizations interface {
Create(ctx context.Context, org *Organization) (created *Organization, err error)
Get(ctx context.Context, orgId string) (org *Organization, err error)
Update(ctx context.Context, org *Organization) (err error)
Delete(ctx context.Context, orgId string) (err error)
Find(ctx context.Context, filter *Filter, opts *options.FindOptions) (orgs []*Organization, total int, err error)
}
// Organizations
type Filter struct {
ID []string
Name []string
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
package transport
import (
"context"
"errors"
options "git.perx.ru/perxis/perxis-go/pkg/options"
organizations "git.perx.ru/perxis/perxis-go/pkg/organizations"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
func (set EndpointsSet) Create(arg0 context.Context, arg1 *organizations.Organization) (res0 *organizations.Organization, res1 error) {
request := CreateRequest{Org: arg1}
response, res1 := set.CreateEndpoint(arg0, &request)
if res1 != nil {
if e, ok := status.FromError(res1); ok || e.Code() == codes.Internal || e.Code() == codes.Unknown {
res1 = errors.New(e.Message())
}
return
}
return response.(*CreateResponse).Created, res1
}
func (set EndpointsSet) Get(arg0 context.Context, arg1 string) (res0 *organizations.Organization, res1 error) {
request := GetRequest{OrgId: arg1}
response, res1 := set.GetEndpoint(arg0, &request)
if res1 != nil {
if e, ok := status.FromError(res1); ok || e.Code() == codes.Internal || e.Code() == codes.Unknown {
res1 = errors.New(e.Message())
}
return
}
return response.(*GetResponse).Org, res1
}
func (set EndpointsSet) Update(arg0 context.Context, arg1 *organizations.Organization) (res0 error) {
request := UpdateRequest{Org: arg1}
_, res0 = set.UpdateEndpoint(arg0, &request)
if res0 != nil {
if e, ok := status.FromError(res0); ok || e.Code() == codes.Internal || e.Code() == codes.Unknown {
res0 = errors.New(e.Message())
}
return
}
return res0
}
func (set EndpointsSet) Delete(arg0 context.Context, arg1 string) (res0 error) {
request := DeleteRequest{OrgId: arg1}
_, res0 = set.DeleteEndpoint(arg0, &request)
if res0 != nil {
if e, ok := status.FromError(res0); ok || e.Code() == codes.Internal || e.Code() == codes.Unknown {
res0 = errors.New(e.Message())
}
return
}
return res0
}
func (set EndpointsSet) Find(arg0 context.Context, arg1 *organizations.Filter, arg2 *options.FindOptions) (res0 []*organizations.Organization, res1 int, res2 error) {
request := FindRequest{
Filter: arg1,
Opts: arg2,
}
response, res2 := set.FindEndpoint(arg0, &request)
if res2 != nil {
if e, ok := status.FromError(res2); ok || e.Code() == codes.Internal || e.Code() == codes.Unknown {
res2 = errors.New(e.Message())
}
return
}
return response.(*FindResponse).Orgs, response.(*FindResponse).Total, res2
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
package transport
import endpoint "github.com/go-kit/kit/endpoint"
// EndpointsSet implements Organizations API and used for transport purposes.
type EndpointsSet struct {
CreateEndpoint endpoint.Endpoint
GetEndpoint endpoint.Endpoint
UpdateEndpoint endpoint.Endpoint
DeleteEndpoint endpoint.Endpoint
FindEndpoint endpoint.Endpoint
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
package transport
import (
options "git.perx.ru/perxis/perxis-go/pkg/options"
organizations "git.perx.ru/perxis/perxis-go/pkg/organizations"
)
type (
CreateRequest struct {
Org *organizations.Organization `json:"org"`
}
CreateResponse struct {
Created *organizations.Organization `json:"created"`
}
GetRequest struct {
OrgId string `json:"org_id"`
}
GetResponse struct {
Org *organizations.Organization `json:"org"`
}
UpdateRequest struct {
Org *organizations.Organization `json:"org"`
}
// Formal exchange type, please do not delete.
UpdateResponse struct{}
DeleteRequest struct {
OrgId string `json:"org_id"`
}
// Formal exchange type, please do not delete.
DeleteResponse struct{}
FindRequest struct {
Filter *organizations.Filter `json:"filter"`
Opts *options.FindOptions `json:"opts"`
}
FindResponse struct {
Orgs []*organizations.Organization `json:"orgs"`
Total int `json:"total"`
}
)
// Code generated by microgen 0.9.1. DO NOT EDIT.
package transportgrpc
import (
transport "git.perx.ru/perxis/perxis-go/pkg/organizations/transport"
pb "git.perx.ru/perxis/perxis-go/proto/organizations"
grpckit "github.com/go-kit/kit/transport/grpc"
empty "github.com/golang/protobuf/ptypes/empty"
grpc "google.golang.org/grpc"
)
func NewGRPCClient(conn *grpc.ClientConn, addr string, opts ...grpckit.ClientOption) transport.EndpointsSet {
if addr == "" {
addr = "account.organizations.Organizations"
}
return transport.EndpointsSet{
CreateEndpoint: grpckit.NewClient(
conn, addr, "Create",
_Encode_Create_Request,
_Decode_Create_Response,
pb.CreateResponse{},
opts...,
).Endpoint(),
DeleteEndpoint: grpckit.NewClient(
conn, addr, "Delete",
_Encode_Delete_Request,
_Decode_Delete_Response,
empty.Empty{},
opts...,
).Endpoint(),
FindEndpoint: grpckit.NewClient(
conn, addr, "Find",
_Encode_Find_Request,
_Decode_Find_Response,
pb.FindResponse{},
opts...,
).Endpoint(),
GetEndpoint: grpckit.NewClient(
conn, addr, "Get",
_Encode_Get_Request,
_Decode_Get_Response,
pb.GetResponse{},
opts...,
).Endpoint(),
UpdateEndpoint: grpckit.NewClient(
conn, addr, "Update",
_Encode_Update_Request,
_Decode_Update_Response,
empty.Empty{},
opts...,
).Endpoint(),
}
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
// Please, do not change functions names!
package transportgrpc
import (
"context"
"errors"
transport "git.perx.ru/perxis/perxis-go/pkg/organizations/transport"
pb "git.perx.ru/perxis/perxis-go/proto/organizations"
empty "github.com/golang/protobuf/ptypes/empty"
)
func _Encode_Create_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil CreateRequest")
}
req := request.(*transport.CreateRequest)
reqOrg, err := PtrOrganizationToProto(req.Org)
if err != nil {
return nil, err
}
return &pb.CreateRequest{Org: reqOrg}, nil
}
func _Encode_Get_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil GetRequest")
}
req := request.(*transport.GetRequest)
return &pb.GetRequest{OrgId: req.OrgId}, nil
}
func _Encode_Delete_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil DeleteRequest")
}
req := request.(*transport.DeleteRequest)
return &pb.DeleteRequest{OrgId: req.OrgId}, nil
}
func _Encode_Find_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil FindRequest")
}
req := request.(*transport.FindRequest)
reqFilter, err := PtrFilterToProto(req.Filter)
if err != nil {
return nil, err
}
reqOpts, err := PtrServicesFindOptionsToProto(req.Opts)
if err != nil {
return nil, err
}
return &pb.FindRequest{
Filter: reqFilter,
Opts: reqOpts,
}, nil
}
func _Encode_Create_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil CreateResponse")
}
resp := response.(*transport.CreateResponse)
respCreated, err := PtrOrganizationToProto(resp.Created)
if err != nil {
return nil, err
}
return &pb.CreateResponse{Created: respCreated}, nil
}
func _Encode_Get_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil GetResponse")
}
resp := response.(*transport.GetResponse)
respOrg, err := PtrOrganizationToProto(resp.Org)
if err != nil {
return nil, err
}
return &pb.GetResponse{Org: respOrg}, nil
}
func _Encode_Update_Response(ctx context.Context, response interface{}) (interface{}, error) {
return &empty.Empty{}, nil
}
func _Encode_Delete_Response(ctx context.Context, response interface{}) (interface{}, error) {
return &empty.Empty{}, nil
}
func _Encode_Find_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil FindResponse")
}
resp := response.(*transport.FindResponse)
respOrgs, err := ListPtrOrganizationToProto(resp.Orgs)
if err != nil {
return nil, err
}
return &pb.FindResponse{
Orgs: respOrgs,
Total: int64(resp.Total),
}, nil
}
func _Decode_Create_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil CreateRequest")
}
req := request.(*pb.CreateRequest)
reqOrg, err := ProtoToPtrOrganization(req.Org)
if err != nil {
return nil, err
}
return &transport.CreateRequest{Org: reqOrg}, nil
}
func _Decode_Get_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil GetRequest")
}
req := request.(*pb.GetRequest)
return &transport.GetRequest{OrgId: string(req.OrgId)}, nil
}
func _Decode_Delete_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil DeleteRequest")
}
req := request.(*pb.DeleteRequest)
return &transport.DeleteRequest{OrgId: string(req.OrgId)}, nil
}
func _Decode_Find_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil FindRequest")
}
req := request.(*pb.FindRequest)
reqFilter, err := ProtoToPtrFilter(req.Filter)
if err != nil {
return nil, err
}
reqOpts, err := ProtoToPtrServicesFindOptions(req.Opts)
if err != nil {
return nil, err
}
return &transport.FindRequest{
Filter: reqFilter,
Opts: reqOpts,
}, nil
}
func _Decode_Create_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil CreateResponse")
}
resp := response.(*pb.CreateResponse)
respCreated, err := ProtoToPtrOrganization(resp.Created)
if err != nil {
return nil, err
}
return &transport.CreateResponse{Created: respCreated}, nil
}
func _Decode_Get_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil GetResponse")
}
resp := response.(*pb.GetResponse)
respOrg, err := ProtoToPtrOrganization(resp.Org)
if err != nil {
return nil, err
}
return &transport.GetResponse{Org: respOrg}, nil
}
func _Decode_Update_Response(ctx context.Context, response interface{}) (interface{}, error) {
return &empty.Empty{}, nil
}
func _Decode_Delete_Response(ctx context.Context, response interface{}) (interface{}, error) {
return &empty.Empty{}, nil
}
func _Decode_Find_Response(ctx context.Context, response interface{}) (interface{}, error) {
if response == nil {
return nil, errors.New("nil FindResponse")
}
resp := response.(*pb.FindResponse)
respOrgs, err := ProtoToListPtrOrganization(resp.Orgs)
if err != nil {
return nil, err
}
return &transport.FindResponse{
Orgs: respOrgs,
Total: int(resp.Total),
}, nil
}
func _Encode_Update_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil UpdateRequest")
}
req := request.(*transport.UpdateRequest)
reqOrg, err := PtrOrganizationToProto(req.Org)
if err != nil {
return nil, err
}
return &pb.UpdateRequest{Org: reqOrg}, nil
}
func _Decode_Update_Request(ctx context.Context, request interface{}) (interface{}, error) {
if request == nil {
return nil, errors.New("nil UpdateRequest")
}
req := request.(*pb.UpdateRequest)
reqOrg, err := ProtoToPtrOrganization(req.Org)
if err != nil {
return nil, err
}
return &transport.UpdateRequest{Org: reqOrg}, nil
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
// It is better for you if you do not change functions names!
// This file will never be overwritten.
package transportgrpc
import (
"git.perx.ru/perxis/perxis-go/pkg/options"
"git.perx.ru/perxis/perxis-go/pkg/organizations"
"git.perx.ru/perxis/perxis-go/proto/common"
pb "git.perx.ru/perxis/perxis-go/proto/organizations"
)
func PtrOrganizationToProto(org *organizations.Organization) (*pb.Organization, error) {
if org == nil {
return nil, nil
}
po := &pb.Organization{
Id: org.ID,
Name: org.Name,
Description: org.Description,
LogoUrl: org.LogoURL,
OwnerId: org.OwnerID,
}
return po, nil
}
func ProtoToPtrOrganization(protoOrg *pb.Organization) (*organizations.Organization, error) {
if protoOrg == nil {
return nil, nil
}
o := &organizations.Organization{
ID: protoOrg.Id,
Name: protoOrg.Name,
Description: protoOrg.Description,
LogoURL: protoOrg.LogoUrl,
OwnerID: protoOrg.OwnerId,
}
return o, nil
}
func PtrFilterToProto(filter *organizations.Filter) (*pb.Filter, error) {
if filter == nil {
return nil, nil
}
return &pb.Filter{
Ids: filter.ID,
Names: filter.Name,
}, nil
}
func ProtoToPtrFilter(protoFilter *pb.Filter) (*organizations.Filter, error) {
if protoFilter == nil {
return nil, nil
}
return &organizations.Filter{
ID: protoFilter.Ids,
Name: protoFilter.Names,
}, nil
}
func PtrServicesFindOptionsToProto(opts *options.FindOptions) (*common.FindOptions, error) {
if opts == nil {
return nil, nil
}
return &common.FindOptions{
Sort: opts.Sort,
PageNum: int32(opts.PageNum),
PageSize: int32(opts.PageSize),
}, nil
}
func ProtoToPtrServicesFindOptions(protoOpts *common.FindOptions) (*options.FindOptions, error) {
if protoOpts == nil {
return nil, nil
}
return &options.FindOptions{
SortOptions: options.SortOptions{
Sort: protoOpts.Sort,
},
PaginationOptions: options.PaginationOptions{
PageNum: int(protoOpts.PageNum),
PageSize: int(protoOpts.PageSize),
},
}, nil
}
func ListPtrOrganizationToProto(orgs []*organizations.Organization) ([]*pb.Organization, error) {
protoOrgs := make([]*pb.Organization, 0, len(orgs))
for _, o := range orgs {
op, err := PtrOrganizationToProto(o)
if err != nil {
return nil, err
}
protoOrgs = append(protoOrgs, op)
}
return protoOrgs, nil
}
func ProtoToListPtrOrganization(protoOrgs []*pb.Organization) ([]*organizations.Organization, error) {
orgs := make([]*organizations.Organization, 0, len(protoOrgs))
for _, op := range protoOrgs {
o, err := ProtoToPtrOrganization(op)
if err != nil {
return nil, err
}
orgs = append(orgs, o)
}
return orgs, nil
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
// DO NOT EDIT.
package transportgrpc
import (
transport "git.perx.ru/perxis/perxis-go/pkg/organizations/transport"
pb "git.perx.ru/perxis/perxis-go/proto/organizations"
grpc "github.com/go-kit/kit/transport/grpc"
empty "github.com/golang/protobuf/ptypes/empty"
context "golang.org/x/net/context"
)
type organizationsServer struct {
create grpc.Handler
get grpc.Handler
update grpc.Handler
delete grpc.Handler
find grpc.Handler
pb.UnimplementedOrganizationsServer
}
func NewGRPCServer(endpoints *transport.EndpointsSet, opts ...grpc.ServerOption) pb.OrganizationsServer {
return &organizationsServer{
create: grpc.NewServer(
endpoints.CreateEndpoint,
_Decode_Create_Request,
_Encode_Create_Response,
opts...,
),
delete: grpc.NewServer(
endpoints.DeleteEndpoint,
_Decode_Delete_Request,
_Encode_Delete_Response,
opts...,
),
find: grpc.NewServer(
endpoints.FindEndpoint,
_Decode_Find_Request,
_Encode_Find_Response,
opts...,
),
get: grpc.NewServer(
endpoints.GetEndpoint,
_Decode_Get_Request,
_Encode_Get_Response,
opts...,
),
update: grpc.NewServer(
endpoints.UpdateEndpoint,
_Decode_Update_Request,
_Encode_Update_Response,
opts...,
),
}
}
func (S *organizationsServer) Create(ctx context.Context, req *pb.CreateRequest) (*pb.CreateResponse, error) {
_, resp, err := S.create.ServeGRPC(ctx, req)
if err != nil {
return nil, err
}
return resp.(*pb.CreateResponse), nil
}
func (S *organizationsServer) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetResponse, error) {
_, resp, err := S.get.ServeGRPC(ctx, req)
if err != nil {
return nil, err
}
return resp.(*pb.GetResponse), nil
}
func (S *organizationsServer) Update(ctx context.Context, req *pb.UpdateRequest) (*empty.Empty, error) {
_, resp, err := S.update.ServeGRPC(ctx, req)
if err != nil {
return nil, err
}
return resp.(*empty.Empty), nil
}
func (S *organizationsServer) Delete(ctx context.Context, req *pb.DeleteRequest) (*empty.Empty, error) {
_, resp, err := S.delete.ServeGRPC(ctx, req)
if err != nil {
return nil, err
}
return resp.(*empty.Empty), nil
}
func (S *organizationsServer) Find(ctx context.Context, req *pb.FindRequest) (*pb.FindResponse, error) {
_, resp, err := S.find.ServeGRPC(ctx, req)
if err != nil {
return nil, err
}
return resp.(*pb.FindResponse), nil
}
// Code generated by microgen 0.9.1. DO NOT EDIT.
package transport
import (
"context"
organizations "git.perx.ru/perxis/perxis-go/pkg/organizations"
endpoint "github.com/go-kit/kit/endpoint"
)
func Endpoints(svc organizations.Organizations) EndpointsSet {
return EndpointsSet{
CreateEndpoint: CreateEndpoint(svc),
DeleteEndpoint: DeleteEndpoint(svc),
FindEndpoint: FindEndpoint(svc),
GetEndpoint: GetEndpoint(svc),
UpdateEndpoint: UpdateEndpoint(svc),
}
}
func CreateEndpoint(svc organizations.Organizations) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*CreateRequest)
res0, res1 := svc.Create(arg0, req.Org)
return &CreateResponse{Created: res0}, res1
}
}
func GetEndpoint(svc organizations.Organizations) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*GetRequest)
res0, res1 := svc.Get(arg0, req.OrgId)
return &GetResponse{Org: res0}, res1
}
}
func UpdateEndpoint(svc organizations.Organizations) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*UpdateRequest)
res0 := svc.Update(arg0, req.Org)
return &UpdateResponse{}, res0
}
}
func DeleteEndpoint(svc organizations.Organizations) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*DeleteRequest)
res0 := svc.Delete(arg0, req.OrgId)
return &DeleteResponse{}, res0
}
}
func FindEndpoint(svc organizations.Organizations) endpoint.Endpoint {
return func(arg0 context.Context, request interface{}) (interface{}, error) {
req := request.(*FindRequest)
res0, res1, res2 := svc.Find(arg0, req.Filter, req.Opts)
return &FindResponse{
Orgs: res0,
Total: res1,
}, res2
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment