Documentation ¶
Index ¶
- type DataMsg
- type GrpcServiceServer
- type Record
- type RecordHandler
- func (handler *RecordHandler) Down()
- func (handler *RecordHandler) Handle(msg *sarama.ConsumerMessage)
- func (handler *RecordHandler) InsertMany(dataList []*DataMsg)
- func (handler *RecordHandler) Ok() (err error)
- func (handler *RecordHandler) WithDatabase(db *mongo.Database) *RecordHandler
- func (handler *RecordHandler) WithLogger(logger *zap.Logger) *RecordHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrpcServiceServer ¶
type GrpcServiceServer struct {
// contains filtered or unexported fields
}
func (*GrpcServiceServer) Create ¶
func (gss *GrpcServiceServer) Create(ctx context.Context, data *proto.RecordData) ( id *proto.RecordId, err error)
func (*GrpcServiceServer) Serve ¶
func (gss *GrpcServiceServer) Serve(listener net.Listener) (err error)
func (*GrpcServiceServer) Shutdown ¶
func (gss *GrpcServiceServer) Shutdown()
type Record ¶
type Record struct { Id primitive.ObjectID `bson:"_id,omitempty" json:"_id,omitempty"` CreatedAt time.Time `bson:"createdAt" json:"createdAt"` Status bool `bson:"status" json:"status"` Tags []string `bson:"tags" json:"tags"` EventAt time.Time `bson:"eventAt" json:"eventAt"` *proto.RecordData `bson:",inline"` }
func RecordFromData ¶
func RecordFromData(rd *proto.RecordData, createdAt time.Time) Record
type RecordHandler ¶
type RecordHandler struct {
// contains filtered or unexported fields
}
func NewRecordHandler ¶
func NewRecordHandler(vp *viper.Viper) (handler *RecordHandler, err error)
func (*RecordHandler) Down ¶
func (handler *RecordHandler) Down()
func (*RecordHandler) Handle ¶
func (handler *RecordHandler) Handle(msg *sarama.ConsumerMessage)
func (*RecordHandler) InsertMany ¶
func (handler *RecordHandler) InsertMany(dataList []*DataMsg)
func (*RecordHandler) Ok ¶
func (handler *RecordHandler) Ok() (err error)
func (*RecordHandler) WithDatabase ¶
func (handler *RecordHandler) WithDatabase(db *mongo.Database) *RecordHandler
func (*RecordHandler) WithLogger ¶
func (handler *RecordHandler) WithLogger(logger *zap.Logger) *RecordHandler
Click to show internal directories.
Click to hide internal directories.