Skip to content
Snippets Groups Projects
Select Git revision
  • e59e0fcbd5cbc745470cc0c51deb948bf2573ad3
  • master default protected
  • feature/PRXS-3383-CollectionsRankSortAPI
  • fix/PRXS-3401-ValidateValidationOpts
  • feature/3149-LocaleCodeAsID-Feature
  • feature/PRXS-3383-CollectionsSort
  • feature/3109-SerializeFeature
  • release/0.33
  • feature/3109-RecoverySchema
  • feature/3109-feature
  • fix/PRXS-3369-ValidateFields
  • refactor/PRXS-3306-MovePkgGroup1
  • refactor/6-pkg-refactor-expr
  • fix/PRXS-3360-TemplateBuilderPatch
  • feature/3293-MongoV2
  • feature/3272-GoVersionUp
  • feature/PRXS-3218-HideTemplateActions
  • feature/PRXS-3234-PruneIdents
  • feature/3146-UpdateItemStorageInterface
  • feature/3274-ObjectIndexesFixes
  • feature/PRXS-3143-3235-ReferenceOptions
  • v0.33.1
  • v0.32.0
  • v0.31.1
  • v0.31.0
  • v0.30.0
  • v0.29.0
  • v0.28.0
  • v0.27.0-alpha.1+16
  • v0.27.0-alpha.1+15
  • v0.27.0-alpha.1+14
  • v0.27.0-alpha.1+13
  • v0.27.0-alpha.1+12
  • v0.27.0-alpha.1+11
  • v0.27.0-alpha.1+10
  • v0.27.0-alpha.1+9
  • v0.27.0-alpha.1+8
  • v0.27.0-alpha.1+7
  • v0.27.0-alpha.1+6
  • v0.27.0-alpha.1+5
  • v0.27.0-alpha.1+4
41 results

server.microgen.go

Blame
  • user avatar
    ko_oler authored
    fa34f780
    History
    server.microgen.go 2.24 KiB
    // Code generated by microgen 0.9.1. DO NOT EDIT.
    
    package transport
    
    import (
    	"context"
    
    	collections "git.perx.ru/perxis/perxis-go/pkg/collections"
    	endpoint "github.com/go-kit/kit/endpoint"
    )
    
    func Endpoints(svc collections.Collections) EndpointsSet {
    	return EndpointsSet{
    		CreateEndpoint:    CreateEndpoint(svc),
    		DeleteEndpoint:    DeleteEndpoint(svc),
    		GetEndpoint:       GetEndpoint(svc),
    		ListEndpoint:      ListEndpoint(svc),
    		SetSchemaEndpoint: SetSchemaEndpoint(svc),
    		UpdateEndpoint:    UpdateEndpoint(svc),
    	}
    }
    
    func CreateEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*CreateRequest)
    		res0, res1 := svc.Create(arg0, req.Collection)
    		return &CreateResponse{Created: res0}, res1
    	}
    }
    
    func GetEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*GetRequest)
    		res0, res1 := svc.Get(arg0, req.SpaceId, req.EnvId, req.CollectionId, req.Options...)
    		return &GetResponse{Collection: res0}, res1
    	}
    }
    
    func ListEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*ListRequest)
    		res0, res1 := svc.List(arg0, req.SpaceId, req.EnvId, req.Filter)
    		return &ListResponse{Collections: res0}, res1
    	}
    }
    
    func UpdateEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*UpdateRequest)
    		res0 := svc.Update(arg0, req.Coll)
    		return &UpdateResponse{}, res0
    	}
    }
    
    func SetSchemaEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*SetSchemaRequest)
    		res0 := svc.SetSchema(arg0, req.SpaceId, req.EnvId, req.CollectionId, req.Schema)
    		return &SetSchemaResponse{}, res0
    	}
    }
    
    func DeleteEndpoint(svc collections.Collections) endpoint.Endpoint {
    	return func(arg0 context.Context, request interface{}) (interface{}, error) {
    		req := request.(*DeleteRequest)
    		res0 := svc.Delete(arg0, req.SpaceId, req.EnvId, req.CollectionId)
    		return &DeleteResponse{}, res0
    	}
    }