Documentation
¶
Index ¶
- Constants
- Variables
- func NewGatewayService(featureClient featureclient.Client, accountClient accountclient.Client, ...) *gatewayService
- func NewGrpcGatewayService(featureClient featureclient.Client, accountClient accountclient.Client, ...) rpc.Service
- type EventType
- type Option
- func WithAPIKeyMemoryCacheEvictionInterval(interval time.Duration) Option
- func WithAPIKeyMemoryCacheTTL(ttl time.Duration) Option
- func WithFurthestEventTimestamp(d time.Duration) Option
- func WithLogger(l *zap.Logger) Option
- func WithMetrics(r metrics.Registerer) Option
- func WithOldestEventTimestamp(d time.Duration) Option
Constants ¶
View Source
const ( Version = "/v1" Service = "/gateway" )
View Source
const ( ErrRedirectionRequest = "ErrRedirection" ErrorTypeBadRequest = "BadRequest" ErrorTypeUnauthenticated = "Unauthenticated" ErrorTypeForbidden = "Forbidden" ErrorTypeNotFound = "NotFound" ErrPayloadTooLargeRequest = "ErrPayloadTooLarge" ErrorTypeClientClosedRequest = "ClientClosedRequest" ErrorTypeInternalServerError = "InternalServerError" ErrorTypeTimeout = "Timeout" ErrorTypeInternal = "Internal" ErrorTypeNetwork = "Network" ErrorTypeSDKInternal = "SDKInternal" ErrorTypeUnknown = "Unknown" )
Variables ¶
View Source
var ( ErrSDKVersionRequired = status.Error(codes.InvalidArgument, "gateway: sdk version is required") ErrSourceIDRequired = status.Error(codes.InvalidArgument, "gateway: source id is required") ErrUserRequired = status.Error(codes.InvalidArgument, "gateway: user is required") ErrUserIDRequired = status.Error(codes.InvalidArgument, "gateway: user id is required") ErrGoalIDRequired = status.Error(codes.InvalidArgument, "gateway: goal id is required") ErrFeatureIDRequired = status.Error(codes.InvalidArgument, "gateway: feature id is required") ErrTagRequired = status.Error(codes.InvalidArgument, "gateway: tag is required") ErrMissingEvents = status.Error(codes.InvalidArgument, "gateway: missing events") ErrMissingEventID = status.Error(codes.InvalidArgument, "gateway: missing event id") ErrInvalidTimestamp = status.Error(codes.InvalidArgument, "gateway: invalid timestamp") ErrContextCanceled = status.Error(codes.Canceled, "gateway: context canceled") ErrFeatureNotFound = status.Error(codes.NotFound, "gateway: feature not found") ErrEvaluationNotFound = status.Error(codes.NotFound, "gateway: evaluation not found") ErrPushNotFound = status.Error(codes.NotFound, "gateway: push not found") ErrAccountNotFound = status.Error(codes.NotFound, "gateway: account not found") ErrMissingAPIKey = status.Error(codes.Unauthenticated, "gateway: missing APIKey") ErrInvalidAPIKey = status.Error(codes.PermissionDenied, "gateway: invalid APIKey") ErrDisabledAPIKey = status.Error(codes.PermissionDenied, "gateway: disabled APIKey") ErrBadRole = status.Error(codes.PermissionDenied, "gateway: bad role") ErrInternal = status.Error(codes.Internal, "gateway: internal") )
Functions ¶
func NewGatewayService ¶
func NewGatewayService( featureClient featureclient.Client, accountClient accountclient.Client, pushClient pushclient.Client, gp publisher.Publisher, ep publisher.Publisher, up publisher.Publisher, mp publisher.Publisher, redisV3Cache cache.MultiGetCache, opts ...Option, ) *gatewayService
func NewGrpcGatewayService ¶
func NewGrpcGatewayService( featureClient featureclient.Client, accountClient accountclient.Client, pushClient pushclient.Client, codeRefClient coderefclient.Client, gp publisher.Publisher, ep publisher.Publisher, up publisher.Publisher, redisV3Cache cache.MultiGetCache, opts ...Option, ) rpc.Service
Types ¶
type EventType ¶
type EventType int
const ( GoalEventType EventType = iota + 1 // eventType starts from 1 for validation. // Do NOT remove the goalBatchEventType because the go-server-sdk depends on the same order // https://github.com/ca-dp/bucketeer-go-server-sdk/blob/master/pkg/bucketeer/api/rest.go#L35 GoalBatchEventType // nolint:deadcode,unused,varcheck EvaluationEventType MetricsEventType )
type Option ¶
type Option func(*options)
func WithLogger ¶
func WithMetrics ¶
func WithMetrics(r metrics.Registerer) Option
Click to show internal directories.
Click to hide internal directories.