biz

package
v0.0.0-...-3277539 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataMsg

type DataMsg struct {
	RecordData *proto.RecordData
	Fields     []zap.Field
}

type GrpcServiceServer

type GrpcServiceServer struct {
	// contains filtered or unexported fields
}

func NewGSS

func NewGSS(logger *zap.Logger, db *mongo.Database, vp *viper.Viper, otel bool) (
	gss *GrpcServiceServer, err error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL