-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_model.go
37 lines (32 loc) · 1.12 KB
/
data_model.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package provider
import (
"context"
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
"github.com/waduhek/flagger/internal/environment"
"github.com/waduhek/flagger/internal/flag"
"github.com/waduhek/flagger/internal/flagsetting"
)
// FlagDetails contains the details of a particular flag in a particular
// environment.
type FlagDetails struct {
ID primitive.ObjectID `bson:"_id"`
Key string `bson:"key"`
Name string `bson:"name"`
Environment environment.Environment `bson:"environment"`
Flag flag.Flag `bson:"flag"`
FlagSetting flagsetting.FlagSetting `bson:"flag_setting"`
CreatedBy primitive.ObjectID `bson:"created_by"`
CreatedAt time.Time `bson:"created_at"`
UpdatedAt time.Time `bson:"updated_at"`
}
type DataRepository interface {
// GetFlagDetailsByProjectKey gets the details of a flag by the project key,
// environment name and the flag name.
GetFlagDetailsByProjectKey(
ctx context.Context,
projectKey string,
environmentName string,
flagName string,
) ([]FlagDetails, error)
}