Skip to content

Commit

Permalink
Add go mod
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc140583 committed Jul 27, 2024
1 parent ce3f9e5 commit 058db31
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 4 deletions.
13 changes: 9 additions & 4 deletions consumer/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,15 @@ package consumer

import "context"

type SimpleConsumer struct {
Consume func(ctx context.Context, handle func(context.Context, []byte)
Handle func(context.Context, []byte)
}

type Consumer struct {
Consume func(ctx context.Context, handle func(ctx context.Context, data []byte, header map[string]string, err error) error)
Handle func(ctx context.Context, data []byte, header map[string]string, err error) error
Consume func(ctx context.Context, handle func(context.Context, []byte, map[string]string))
Handle func(context.Context, []byte, map[string]string)
}

type Handle func(ctx context.Context, data []byte, header map[string]string, err error) error
type Consume func(ctx context.Context, handle func(ctx context.Context, data []byte, header map[string]string, err error) error)
type Handle func(context.Context, []byte, map[string]string)
type Consume func(context.Context, func(context.Context, []byte, map[string]string))
5 changes: 5 additions & 0 deletions getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package getter

import "context"

type SimpleGetter struct {
Get func(ctx context.Context, handle func(context.Context, []byte)
Handle func(context.Context, []byte)
}

type Getter struct {
Get func(ctx context.Context, handle func(context.Context, []byte, map[string]string))
Handle func(context.Context, []byte, map[string]string)
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/core-go/mq

go 1.18
Empty file added go.sum
Empty file.
5 changes: 5 additions & 0 deletions reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package reader

import "context"

type SimpleReader struct {
Read func(ctx context.Context, handle func(context.Context, []byte)
Handle func(context.Context, []byte)
}

type Reader struct {
Read func(ctx context.Context, handle func(context.Context, []byte, map[string]string))
Handle func(context.Context, []byte, map[string]string)
Expand Down
5 changes: 5 additions & 0 deletions receiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package receiver

import "context"

type SimpleReceiver struct {
Receive func(ctx context.Context, handle func(context.Context, []byte))
Handle func(context.Context, []byte)
}

type Receiver struct {
Receive func(ctx context.Context, handle func(context.Context, []byte, map[string]string))
Handle func(context.Context, []byte, map[string]string)
Expand Down
5 changes: 5 additions & 0 deletions subscriber/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ package subscriber

import "context"

type SimpleSubscriber struct {
Subscribe func(ctx context.Context, handle func(context.Context, []byte))
Handle func(context.Context, []byte)
}

type Subscriber struct {
Subscribe func(ctx context.Context, handle func(context.Context, []byte, map[string]string))
Handle func(context.Context, []byte, map[string]string)
Expand Down

0 comments on commit 058db31

Please sign in to comment.