-
Notifications
You must be signed in to change notification settings - Fork 2
/
module.go
43 lines (36 loc) · 951 Bytes
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package authz
import (
"github.com/cosmos/cosmos-sdk/codec"
"github.com/rs/zerolog"
grpcClient "github.com/bro-n-bro/spacebox-crawler/client/grpc"
"github.com/bro-n-bro/spacebox-crawler/modules/utils"
tb "github.com/bro-n-bro/spacebox-crawler/pkg/mapper/to_broker"
"github.com/bro-n-bro/spacebox-crawler/types"
)
const (
ModuleName = "authz"
)
var (
_ types.Module = &Module{}
_ types.RecursiveMessagesHandler = &Module{}
)
// Module is a module for authz.
type Module struct {
log *zerolog.Logger
client *grpcClient.Client
broker broker
tbM tb.ToBroker
cdc codec.Codec
}
// New creates a new authz module.
func New(b broker, cli *grpcClient.Client, tb tb.ToBroker, cdc codec.Codec) *Module {
return &Module{
log: utils.NewModuleLogger(ModuleName),
broker: b,
tbM: tb,
client: cli,
cdc: cdc,
}
}
// Name returns the module name.
func (m *Module) Name() string { return ModuleName }