Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
Fix lint errors (#709)
Browse files Browse the repository at this point in the history
* fix lint errors

* restore permissions
  • Loading branch information
lionelvillard authored Jun 16, 2021
1 parent 9d00113 commit 0288941
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 65 deletions.
7 changes: 3 additions & 4 deletions pkg/source/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ func NewEnvConfig() adapter.EnvConfigAccessor {
}

type Adapter struct {
config *AdapterConfig
controlServer *ctrlnetwork.ControlServer
saramaConfig *sarama.Config
offsetInitialized bool
config *AdapterConfig
controlServer *ctrlnetwork.ControlServer
saramaConfig *sarama.Config

httpMessageSender *kncloudevents.HTTPMessageSender
reporter pkgsource.StatsReporter
Expand Down
61 changes: 0 additions & 61 deletions pkg/source/adapter/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,64 +442,3 @@ func TestAdapter_Start(t *testing.T) { // just increase code coverage
}
cancel()
}

type sampleConsumerSession struct {
offsets map[string]map[int32]int64
committed bool
}

func (s *sampleConsumerSession) Claims() map[string][]int32 {
return nil
}

func (s *sampleConsumerSession) MemberID() string {
return ""
}

func (s *sampleConsumerSession) GenerationID() int32 {
return int32(0)
}

func (s *sampleConsumerSession) GetOffset(topic string, partition int32) int64 {
if s.offsets == nil {
return -2
}
partitions, ok := s.offsets[topic]
if !ok {
return -2
}
offset, ok := partitions[partition]
if !ok {
return -2
}
return offset
}

func (s *sampleConsumerSession) MarkOffset(topic string, partition int32, offset int64, metadata string) {
if s.offsets == nil {
s.offsets = make(map[string]map[int32]int64)
}

partitions, ok := s.offsets[topic]
if !ok {
partitions = make(map[int32]int64)
s.offsets[topic] = partitions
}
partitions[partition] = offset
}

func (s *sampleConsumerSession) Commit() {
s.committed = true
}

func (s *sampleConsumerSession) ResetOffset(topic string, partition int32, offset int64, metadata string) {

}

func (s *sampleConsumerSession) MarkMessage(msg *sarama.ConsumerMessage, metadata string) {

}

func (s *sampleConsumerSession) Context() context.Context {
return nil
}

0 comments on commit 0288941

Please sign in to comment.