Documentation ¶
Index ¶
- func DeleteFeature(ctx context.Context, feature Feature, db storage.Database) error
- func DeleteOrganization(ctx context.Context, org Organization, db storage.Database) error
- func DeleteSDKConnection(ctx context.Context, sdkconnection SDKConnection, db storage.Database) error
- func DeleteUser(ctx context.Context, user User, db storage.Database) error
- func UpdateFeature(ctx context.Context, feature Feature, db storage.Database) error
- func UpdateOrganization(ctx context.Context, org Organization, db storage.Database) error
- func UpdateSDKConnection(ctx context.Context, sdkconnection SDKConnection, db storage.Database) error
- func UpdateUser(ctx context.Context, user User, db storage.Database) error
- type EnvironmentSetting
- type ExperimentRefVariation
- type ExperimentValue
- type Feature
- type FeaturePrerequisite
- type FeatureRule
- type FeatureRuleType
- type FeatureValueType
- type MockCollection
- func (c *MockCollection) DeleteMany(ctx context.Context, filter interface{}) error
- func (c *MockCollection) DeleteOne(ctx context.Context, filter interface{}) error
- func (c *MockCollection) FindOne(ctx context.Context, filter interface{}) (storage.Decoder, error)
- func (c *MockCollection) InsertOne(ctx context.Context, doc interface{}) error
- func (c *MockCollection) UpdateOne(ctx context.Context, filter interface{}, doc interface{}) error
- type MockDatabase
- type MockDisconnect
- type MockResult
- type NamespaceValue
- type Organization
- type OrganizationMember
- type SDKConnection
- type SDKConnectionProxy
- type SavedGroupTargeting
- type SavedGroupTargetingMatch
- type ScheduleRule
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteFeature ¶
func DeleteOrganization ¶
func DeleteSDKConnection ¶
func UpdateFeature ¶
func UpdateOrganization ¶
func UpdateSDKConnection ¶
Types ¶
type EnvironmentSetting ¶
type EnvironmentSetting struct { Enabled bool `bson:"enabled"` Rules []FeatureRule `bson:"rules"` }
type ExperimentRefVariation ¶ added in v0.4.1
type ExperimentValue ¶ added in v0.4.0
type Feature ¶
type Feature struct { ID string `bson:"id"` Owner string `bson:"owner"` Description string `bson:"description"` Tags []string `bson:"tags"` DefaultValue string `bson:"defaultValue"` ValueType FeatureValueType `bson:"valueType"` Organization string `bson:"organization"` Environments []string `bson:"environment"` EnvironmentSettings map[string]EnvironmentSetting `bson:"environmentSettings"` DateCreated time.Time `bson:"dateCreated"` DateUpdated time.Time `bson:"dateUpdated"` Archived bool `bson:"archived"` Revision int `bson:"__v"` }
func (*Feature) FromV1beta1 ¶
func (f *Feature) FromV1beta1(feature v1beta1.GrowthbookFeature) *Feature
type FeaturePrerequisite ¶ added in v0.4.0
type FeatureRule ¶ added in v0.4.0
type FeatureRule struct { ID string `bson:"id,omitempty"` Type FeatureRuleType `bson:"type,omitempty"` Description string `bson:"description,omitempty"` Condition string `bson:"condition,omitempty"` Enabled bool `bson:"enabled,omitempty"` ScheduleRules []ScheduleRule `bson:"scheduleRules,omitempty"` SavedGroups []SavedGroupTargeting `bson:"savedGroups,omitempty"` Prerequisites []FeaturePrerequisite `bson:"prerequisites,omitempty"` Value string `bson:"value,omitempty"` Coverage float64 `bson:"coverage,omitempty"` HashAttribute string `bson:"hashAttribute,omitempty"` TrackingKey string `bson:"trackingKey,omitempty"` FallbackAttribute *string `bson:"fallbackAttribute,omitempty"` DisableStickyBucketing *bool `bson:"disableStickyBucketing,omitempty"` BucketVersion *float64 `bson:"bucketVersion,omitempty"` MinBucketVersion *float64 `bson:"minBucketVersion,omitempty"` Namespace *NamespaceValue `bson:"namespace,omitempty"` Values []ExperimentValue `bson:"values,omitempty"` ExperimentID string `bson:"experimentId,omitempty"` Variations []ExperimentRefVariation `bson:"variations,omitempty"` }
type FeatureRuleType ¶ added in v0.4.0
type FeatureRuleType string
var ( FeatureRuleTypeForce FeatureRuleType = "force" FeatureRuleTypeRollout FeatureRuleType = "rollout" FeatureRuleTypeExperiment FeatureRuleType = "experiment" FeatureRuleTypeExperimentRef FeatureRuleType = "experiment-ref" )
type FeatureValueType ¶
type FeatureValueType string
var ( FeatureValueTypeBoolean FeatureValueType = "boolean" FeatureValueTypeString FeatureValueType = "string" FeatureValueTypeNumber FeatureValueType = "number" FeatureValueTypeJSON FeatureValueType = "json" )
type MockCollection ¶
type MockCollection struct {
// contains filtered or unexported fields
}
func (*MockCollection) DeleteMany ¶
func (c *MockCollection) DeleteMany(ctx context.Context, filter interface{}) error
func (*MockCollection) DeleteOne ¶
func (c *MockCollection) DeleteOne(ctx context.Context, filter interface{}) error
type MockDatabase ¶
type MockDatabase struct { FindOne func(ctx context.Context, filter interface{}) (storage.Decoder, error) DeleteOne func(ctx context.Context, filter interface{}) error InsertOne func(ctx context.Context, doc interface{}) error UpdateOne func(ctx context.Context, filter interface{}, doc interface{}) error DeleteMany func(ctx context.Context, filter interface{}) error }
func (*MockDatabase) Collection ¶
func (d *MockDatabase) Collection(collName string) storage.Collection
type MockDisconnect ¶
type MockDisconnect struct { }
func (*MockDisconnect) Disconnect ¶
func (d *MockDisconnect) Disconnect(ctx context.Context) error
type MockResult ¶ added in v0.4.2
type MockResult struct {
// contains filtered or unexported fields
}
func (*MockResult) Decode ¶ added in v0.4.2
func (r *MockResult) Decode(dst interface{}) error
type NamespaceValue ¶ added in v0.4.0
type Organization ¶
type Organization struct { ID string `bson:"id"` OwnerEmail string `bson:"ownerEmail"` Name string `bson:"name"` DateCreated time.Time `bson:"dateCreated"` Members []OrganizationMember `bson:"members"` Revision int `bson:"__v"` }
func (*Organization) FromV1beta1 ¶
func (o *Organization) FromV1beta1(org v1beta1.GrowthbookOrganization) *Organization
type OrganizationMember ¶
type SDKConnection ¶
type SDKConnection struct { ID string `bson:"id"` Key string `bson:"key"` Languages []string `bson:"languages"` Name string `bson:"name"` Environment string `bson:"environment"` EncryptPayload bool `bson:"encryptPayload"` EncryptionKey string `bson:"encryptionKey"` Organization string `bson:"organization"` Project string `bson:"project"` IncludeVisualExperiments bool `bson:"includeVisualExperiments"` IncludeDraftExperiments bool `bson:"includeDraftExperiments"` IncludeExperimentNames bool `bson:"includeExperimentNames"` DateCreated time.Time `bson:"dateCreated"` DateUpdated time.Time `bson:"dateUpdated"` Proxy SDKConnectionProxy `bson:"proxy"` Revision int `bson:"__v"` }
func (*SDKConnection) FromV1beta1 ¶
func (s *SDKConnection) FromV1beta1(client v1beta1.GrowthbookClient) *SDKConnection
type SDKConnectionProxy ¶
type SDKConnectionProxy struct {
SigningKey string `bson:"signingKey"`
}
type SavedGroupTargeting ¶ added in v0.4.0
type SavedGroupTargeting struct { Match SavedGroupTargetingMatch `bson:"match,omitempty"` IDs []string `bson:"ids,omitempty"` }
type SavedGroupTargetingMatch ¶ added in v0.4.0
type SavedGroupTargetingMatch string
var ( SavedGroupTargetingMatchAll SavedGroupTargetingMatch = "all" SavedGroupTargetingMatchNone SavedGroupTargetingMatch = "none" SavedGroupTargetingMatchAny SavedGroupTargetingMatch = "any" )
type ScheduleRule ¶ added in v0.4.0
type User ¶
type User struct { ID string `bson:"id"` Email string `bson:"email"` Name string `bson:"name"` PasswordHash string `bson:"passwordHash"` Revision int `bson:"__v"` }
func (*User) FromV1beta1 ¶
func (u *User) FromV1beta1(user v1beta1.GrowthbookUser) *User
func (*User) SetPassword ¶
SetPassword is compatible to https://github.com/growthbook/growthbook/blob/bbe5e54d00c8f9c8a7a575f78bf11ab1dc85cd24/packages/back-end/src/services/users.ts#L16
Click to show internal directories.
Click to hide internal directories.