Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Databases DBsyncapod = "syncapod" // Collections ColPodcast = "podcast" ColEpisode = "episode" ColSession = "session" ColUser = "user" ColUserEpisode = "user_episode" ColSubscription = "subscription" ColAuthCode = "oauth_auth_code" ColAccessToken = "oauth_access_token" )
these constants are for database actions
Variables ¶
This section is empty.
Functions ¶
func NewMongoClient ¶
func NewMongoClient(cfg *config.Config) (*mongodb.MongoClient, error)
CreateMongoClient makes a connection with the mongo client
Types ¶
type ObjectIDCodec ¶
type ObjectIDCodec struct{}
ObjectIDCodec is the codec responsible for encoding and decoding the custom protobuf objectID to the mongodb primitive.Object
func (*ObjectIDCodec) DecodeValue ¶
func (o *ObjectIDCodec) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error
DecodeValue decodes primitive.ObjectID to protos.ObjectID
func (*ObjectIDCodec) EncodeValue ¶
func (o *ObjectIDCodec) EncodeValue(en bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error
EncodeValue encodes protos.ObjectID to primitive.ObjectID
type TimestampCodec ¶
type TimestampCodec struct{}
TimestampCodec is the codec responsible for encoding and decoding timestamp values implements ValueCodec which in turn implements ValueEncoder & ValueDecoder. All of the bsoncodec package of mongo driver
func (*TimestampCodec) DecodeValue ¶
func (t *TimestampCodec) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error
DecodeValue decodes the bson to timestamp
func (*TimestampCodec) EncodeValue ¶
func (t *TimestampCodec) EncodeValue(en bsoncodec.EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error
EncodeValue encodes a timestamp to bson
Click to show internal directories.
Click to hide internal directories.