Documentation
¶
Index ¶
- type MongoClient
- func (client MongoClient) AddMember(ctx context.Context, uuid, userUuid string) error
- func (client MongoClient) GetById(ctx context.Context, uuid string, result interface{}) error
- func (client MongoClient) Initialize(ctx context.Context, appConfig appconfigs.AppConfig) error
- func (client MongoClient) RollbackAddMember(ctx context.Context, uuid, userUuid string) error
- func (client MongoClient) SetAppConfigLock(ctx context.Context, uuid string, lock bool) error
- func (client MongoClient) UpdateByFlag(ctx context.Context, uuid, flag string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoClient ¶
type MongoClient struct {
// contains filtered or unexported fields
}
MongoClient implements the apptokens.Repository interface
func NewMongoClient ¶
func NewMongoClient(conn *mongo.Client) *MongoClient
func (MongoClient) AddMember ¶
func (client MongoClient) AddMember(ctx context.Context, uuid, userUuid string) error
func (MongoClient) GetById ¶
func (client MongoClient) GetById(ctx context.Context, uuid string, result interface{}) error
GetById looks up the app token behind the uuid and writes the result in the passed pointer // to the result. If none found returns mongo.ErrNoDocuments
func (MongoClient) Initialize ¶
func (client MongoClient) Initialize(ctx context.Context, appConfig appconfigs.AppConfig) error
InsertOne inserts one data point into the mongo database for a given db name and collection name. Query must be any of bson.* or a struct with bson tags Returned data from the coll.InsertOne are ignored and will not be returned by the function
func (MongoClient) RollbackAddMember ¶
func (client MongoClient) RollbackAddMember(ctx context.Context, uuid, userUuid string) error
func (MongoClient) SetAppConfigLock ¶
func (MongoClient) UpdateByFlag ¶
func (client MongoClient) UpdateByFlag(ctx context.Context, uuid, flag string, data interface{}) error
UpdateByFlag updates one config of the AppConfig (funnel, campaign, btn_time)
Click to show internal directories.
Click to hide internal directories.