Documentation ¶
Index ¶
- Variables
- type CacheRepository
- type DataRepository
- type FlagDetails
- type FlagProviderServer
- type MongoDataRepository
- type RedisCacheRepository
- func (r *RedisCacheRepository) CacheFlagStatus(ctx context.Context, params *cacheParameters, status bool) error
- func (r *RedisCacheRepository) GetFlagStatus(ctx context.Context, params *cacheParameters) (bool, error)
- func (r *RedisCacheRepository) IsFlagStatusCached(ctx context.Context, params *cacheParameters) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrFetchFlagDetails = status.Error( codes.Internal, "error occurred while fetching flag details", )
ErrFetchFlagDetails is a GRPC error that is returned when an unknown error occurs while fetching flag details.
View Source
var ErrIncorrectFlagDetailCount = status.Error( codes.Internal, "an unexpected number of flags were found", )
ErrIncorrectFlagDetailCount is a GRPC error that is returned when the number of flag details does not match the expected count.
View Source
var ErrStatusCache = status.Error( codes.Internal, "error occurred while checking flag status cache", )
ErrStatusCache is a GRPC error that is returned when an error has occurred while checking the cache for the flag status.
Functions ¶
This section is empty.
Types ¶
type CacheRepository ¶
type CacheRepository interface { // IsStatusCached checks if the flag status is already cached IsFlagStatusCached( ctx context.Context, params *cacheParameters, ) (bool, error) // GetFlagStatus gets the currently cached value of the flag status. GetFlagStatus(ctx context.Context, params *cacheParameters) (bool, error) // CacheFlagStatus caches the value of the flag status. CacheFlagStatus( ctx context.Context, params *cacheParameters, status bool, ) error }
CacheRepository provides the interface for acessing the cache for storing flag statuses.
type DataRepository ¶
type FlagDetails ¶
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"` }
FlagDetails contains the details of a particular flag in a particular environment.
type FlagProviderServer ¶
type FlagProviderServer struct { providerpb.UnimplementedFlagProviderServer // contains filtered or unexported fields }
FlagProviderServer is an implementation of the FlagProvider service.
func NewFlagProviderServer ¶
func NewFlagProviderServer( providerDataRepo DataRepository, providerCacheRepo CacheRepository, ) *FlagProviderServer
func (*FlagProviderServer) GetFlag ¶
func (s *FlagProviderServer) GetFlag( ctx context.Context, req *providerpb.GetFlagRequest, ) (*providerpb.GetFlagResponse, error)
type MongoDataRepository ¶
type MongoDataRepository struct {
// contains filtered or unexported fields
}
func NewProviderRepository ¶
func NewProviderRepository(db *mongo.Database) *MongoDataRepository
func (*MongoDataRepository) GetFlagDetailsByProjectKey ¶
func (r *MongoDataRepository) GetFlagDetailsByProjectKey( ctx context.Context, projectKey string, environmentName string, flagName string, ) ([]FlagDetails, error)
type RedisCacheRepository ¶
type RedisCacheRepository struct {
// contains filtered or unexported fields
}
func NewProviderCacheRepository ¶
func NewProviderCacheRepository(rdb *redis.Client) *RedisCacheRepository
func (*RedisCacheRepository) CacheFlagStatus ¶
func (r *RedisCacheRepository) CacheFlagStatus( ctx context.Context, params *cacheParameters, status bool, ) error
func (*RedisCacheRepository) GetFlagStatus ¶
func (r *RedisCacheRepository) GetFlagStatus( ctx context.Context, params *cacheParameters, ) (bool, error)
func (*RedisCacheRepository) IsFlagStatusCached ¶
func (r *RedisCacheRepository) IsFlagStatusCached( ctx context.Context, params *cacheParameters, ) (bool, error)
Click to show internal directories.
Click to hide internal directories.