Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var EFetchFlagDetails = status.Error( codes.Internal, "error occurred while fetching flag details", )
EFetchFlagDetails is a GRPC error that is returned when an unknown error occurs while fetching flag details.
View Source
var EIncorrectFlagDetailCount = status.Error( codes.Internal, "an unexpected number of flags were found", )
EIncorrectFlagDetailCount is a GRPC error that is returned when the number of flag details does not match the expected count.
View Source
var EStatusCache = status.Error( codes.Internal, "error occurred while checking flag status cache", )
EStatusCache is a GRPC error that is returned when an error has occurred while checking the cache for the flag status.
Functions ¶
func NewProviderCacheRepository ¶
func NewProviderCacheRepository(rdb *redis.Client) *providerCacheRepository
func NewProviderRepository ¶
Types ¶
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( providerRepo ProviderRepository, cacheRepo ProviderCacheRepository, ) *FlagProviderServer
func (*FlagProviderServer) GetFlag ¶
func (s *FlagProviderServer) GetFlag( ctx context.Context, req *providerpb.GetFlagRequest, ) (*providerpb.GetFlagResponse, error)
type ProviderCacheRepository ¶
type ProviderCacheRepository 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 }
ProviderCacheRepository provides the interface for acessing the cache for storing flag statuses.
type ProviderRepository ¶
Click to show internal directories.
Click to hide internal directories.