Documentation ¶
Index ¶
- func CheckMongoConnectionFiles(log *zap.Logger) error
- func ContainsRole(seat Seat, requiredRoles []Role) bool
- func ValidateStruct(s interface{}) error
- type MongoConnection
- func (mongoConnection *MongoConnection) CheckDatabaseAndCollectionExists(ctx context.Context) error
- func (mongoConnection *MongoConnection) CheckMongoConnectability(ctx context.Context) error
- func (mongoConnection *MongoConnection) CountSeats(ctx context.Context, subscriptionID string) (int64, error)
- func (mongoConnection *MongoConnection) CreateSeat(ctx context.Context, seat Seat) error
- func (mongoConnection *MongoConnection) CreateTrial(ctx context.Context, trial Trial) error
- func (mongoConnection *MongoConnection) CreateUser(ctx context.Context, user User) error
- func (mongoConnection *MongoConnection) DeleteSeat(ctx context.Context, seat Seat) error
- func (mongoConnection *MongoConnection) DeleteUser(ctx context.Context, customerID string) error
- func (mongoConnection *MongoConnection) EnsureIndexes() error
- func (mongoConnection *MongoConnection) GetAllSeats(ctx context.Context, subscriptionID string) ([]Seat, error)
- func (mongoConnection *MongoConnection) GetOwnerSeat(ctx context.Context, subscriptionID string) (Seat, error)
- func (mongoConnection *MongoConnection) GetSeat(ctx context.Context, subscriptionID, uid string) (Seat, error)
- func (mongoConnection *MongoConnection) GetSeats(ctx context.Context, subscriptionID string, pageIndex int, pageSize int) ([]Seat, error)
- func (mongoConnection *MongoConnection) GetTrial(ctx context.Context, trialFilter TrialFilter) (Trial, error)
- func (mongoConnection *MongoConnection) GetUser(ctx context.Context, userFilter User) (User, error)
- func (mongoConnection *MongoConnection) HasPermission(ctx context.Context, tokenDetails firebasemanager.TokenDetails, ...) error
- func (mongoConnection *MongoConnection) UpdateSeat(ctx context.Context, seat Seat) error
- func (mongoConnection *MongoConnection) UpdateUser(ctx context.Context, user User) error
- type Role
- type Seat
- type Trial
- type TrialFilter
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsRole ¶
func ValidateStruct ¶
func ValidateStruct(s interface{}) error
Types ¶
type MongoConnection ¶
func InitMongoConnection ¶
func (*MongoConnection) CheckDatabaseAndCollectionExists ¶
func (mongoConnection *MongoConnection) CheckDatabaseAndCollectionExists(ctx context.Context) error
func (*MongoConnection) CheckMongoConnectability ¶
func (mongoConnection *MongoConnection) CheckMongoConnectability(ctx context.Context) error
func (*MongoConnection) CountSeats ¶
func (*MongoConnection) CreateSeat ¶
func (mongoConnection *MongoConnection) CreateSeat(ctx context.Context, seat Seat) error
func (*MongoConnection) CreateTrial ¶
func (mongoConnection *MongoConnection) CreateTrial(ctx context.Context, trial Trial) error
func (*MongoConnection) CreateUser ¶
func (mongoConnection *MongoConnection) CreateUser(ctx context.Context, user User) error
func (*MongoConnection) DeleteSeat ¶
func (mongoConnection *MongoConnection) DeleteSeat(ctx context.Context, seat Seat) error
func (*MongoConnection) DeleteUser ¶
func (mongoConnection *MongoConnection) DeleteUser(ctx context.Context, customerID string) error
func (*MongoConnection) EnsureIndexes ¶
func (mongoConnection *MongoConnection) EnsureIndexes() error
func (*MongoConnection) GetAllSeats ¶
func (*MongoConnection) GetOwnerSeat ¶
func (*MongoConnection) GetTrial ¶
func (mongoConnection *MongoConnection) GetTrial(ctx context.Context, trialFilter TrialFilter) (Trial, error)
func (*MongoConnection) HasPermission ¶
func (mongoConnection *MongoConnection) HasPermission(ctx context.Context, tokenDetails firebasemanager.TokenDetails, subscriptionID string, requiredRoles []Role) error
func (*MongoConnection) UpdateSeat ¶
func (mongoConnection *MongoConnection) UpdateSeat(ctx context.Context, seat Seat) error
func (*MongoConnection) UpdateUser ¶
func (mongoConnection *MongoConnection) UpdateUser(ctx context.Context, user User) error
type Seat ¶
type Seat struct { SubscriptionID string `bson:"subscriptionID" json:"subscriptionID" validate:"required"` UID string `bson:"uid" json:"uid" validate:"required"` EMail string `bson:"email" json:"email" validate:"required"` EMailVerified *bool `bson:"emailVerified" json:"emailVerified" validate:"required"` Roles []Role `bson:"roles" json:"roles" validate:"required"` }
type Trial ¶
type Trial struct { SubscriptionID string `bson:"subscriptionID" validate:"required" index:"unique"` ProductType string `bson:"productType" validate:"required"` CustomerID string `bson:"customerID,omitempty" index:"unique" validate:"required"` PaymentCardFingerprint string `bson:"paymentCardFingerprint,omitempty" index:"unique"` PaymentPayPalEMail string `bson:"paymentPayPalEMail,omitempty" index:"unique"` PaymentSEPAFingerprint string `bson:"paymentSEPAFingerprint,omitempty" index:"unique"` }
type TrialFilter ¶
type TrialFilter struct { ProductType string `bson:"productType" validate:"required"` CustomerID string `bson:"customerID,omitempty" index:"unique" validate:"required"` PaymentCardFingerprint string `bson:"paymentCardFingerprint,omitempty" index:"unique"` PaymentPayPalEMail string `bson:"paymentPayPalEMail,omitempty" index:"unique"` PaymentSEPAFingerprint string `bson:"paymentSEPAFingerprint,omitempty" index:"unique"` }
Click to show internal directories.
Click to hide internal directories.