-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6aebc86
commit d1dcea1
Showing
3 changed files
with
93 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,53 @@ | ||
package queues | ||
|
||
import ( | ||
"github.com/sivaosorg/govm/apix" | ||
) | ||
|
||
type KafkaService interface { | ||
} | ||
|
||
type kafkaServiceImpl struct { | ||
conf []apix.ApiRequestConfig | ||
} | ||
|
||
func NewKafkaService(conf []apix.ApiRequestConfig) KafkaService { | ||
return &kafkaServiceImpl{ | ||
conf: conf, | ||
} | ||
} | ||
|
||
func NewKafkaServiceSlices(conf ...apix.ApiRequestConfig) KafkaService { | ||
return &kafkaServiceImpl{ | ||
conf: conf, | ||
} | ||
} | ||
|
||
// func (s *kafkaServiceImpl) ProduceCallback(request KafkaPublisherRequest) (*restify.Response, error) { | ||
// err := KafkaPublisherRequestValidator(request) | ||
// if err != nil { | ||
// return nil, err | ||
// } | ||
// if len(s.conf) == 0 { | ||
// return nil, fmt.Errorf("API Conf is required") | ||
// } | ||
// configs, ok := apix.Get(s.conf, request.TenantKey) | ||
// if !ok { | ||
// return nil, fmt.Errorf("Tenant Key undefined: %v", request.TenantKey) | ||
// } | ||
// endpoint, err := configs.GetEndpoint(request.TopicKey) | ||
// if err != nil { | ||
// return nil, err | ||
// } | ||
// if len(request.Payload) > 0 { | ||
// for k, v := range request.Payload { | ||
// endpoint.AppendBodyWith(k, v) | ||
// } | ||
// } | ||
// svc := apix.NewApiService(configs) | ||
// return svc.Do(nil, endpoint) | ||
// } | ||
|
||
// func (s *kafkaServiceImpl) ProduceCallbackNoneWait(request KafkaPublisherRequest) { | ||
// go s.ProduceCallback(request) | ||
// } |