Documentation ¶
Index ¶
- func EmptyFieldError(field string) error
- func InvalidFieldError(field, reason string) error
- type ErrInvalidField
- type Option
- type Server
- func (s *Server) CreateConstraint(ctx context.Context, req *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
- func (s *Server) CreateDistribution(ctx context.Context, req *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
- func (s *Server) CreateFlag(ctx context.Context, req *flipt.CreateFlagRequest) (*flipt.Flag, error)
- func (s *Server) CreateRule(ctx context.Context, req *flipt.CreateRuleRequest) (*flipt.Rule, error)
- func (s *Server) CreateSegment(ctx context.Context, req *flipt.CreateSegmentRequest) (*flipt.Segment, error)
- func (s *Server) CreateVariant(ctx context.Context, req *flipt.CreateVariantRequest) (*flipt.Variant, error)
- func (s *Server) DeleteConstraint(ctx context.Context, req *flipt.DeleteConstraintRequest) (*empty.Empty, error)
- func (s *Server) DeleteDistribution(ctx context.Context, req *flipt.DeleteDistributionRequest) (*empty.Empty, error)
- func (s *Server) DeleteFlag(ctx context.Context, req *flipt.DeleteFlagRequest) (*empty.Empty, error)
- func (s *Server) DeleteRule(ctx context.Context, req *flipt.DeleteRuleRequest) (*empty.Empty, error)
- func (s *Server) DeleteSegment(ctx context.Context, req *flipt.DeleteSegmentRequest) (*empty.Empty, error)
- func (s *Server) DeleteVariant(ctx context.Context, req *flipt.DeleteVariantRequest) (*empty.Empty, error)
- func (s *Server) ErrorUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func (s *Server) Evaluate(ctx context.Context, req *flipt.EvaluationRequest) (*flipt.EvaluationResponse, error)
- func (s *Server) GetFlag(ctx context.Context, req *flipt.GetFlagRequest) (*flipt.Flag, error)
- func (s *Server) GetRule(ctx context.Context, req *flipt.GetRuleRequest) (*flipt.Rule, error)
- func (s *Server) GetSegment(ctx context.Context, req *flipt.GetSegmentRequest) (*flipt.Segment, error)
- func (s *Server) ListFlags(ctx context.Context, req *flipt.ListFlagRequest) (*flipt.FlagList, error)
- func (s *Server) ListRules(ctx context.Context, req *flipt.ListRuleRequest) (*flipt.RuleList, error)
- func (s *Server) ListSegments(ctx context.Context, req *flipt.ListSegmentRequest) (*flipt.SegmentList, error)
- func (s *Server) OrderRules(ctx context.Context, req *flipt.OrderRulesRequest) (*empty.Empty, error)
- func (s *Server) UpdateConstraint(ctx context.Context, req *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
- func (s *Server) UpdateDistribution(ctx context.Context, req *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
- func (s *Server) UpdateFlag(ctx context.Context, req *flipt.UpdateFlagRequest) (*flipt.Flag, error)
- func (s *Server) UpdateRule(ctx context.Context, req *flipt.UpdateRuleRequest) (*flipt.Rule, error)
- func (s *Server) UpdateSegment(ctx context.Context, req *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
- func (s *Server) UpdateVariant(ctx context.Context, req *flipt.UpdateVariantRequest) (*flipt.Variant, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyFieldError ¶ added in v0.1.0
EmptyFieldError creates an ErrInvalidField for an empty field
func InvalidFieldError ¶ added in v0.1.0
InvalidFieldError creates an ErrInvalidField for a specific field and reason
Types ¶
type ErrInvalidField ¶ added in v0.1.0
type ErrInvalidField struct {
// contains filtered or unexported fields
}
ErrInvalidField represents a validation error
func (ErrInvalidField) Error ¶ added in v0.1.0
func (e ErrInvalidField) Error() string
type Option ¶ added in v0.2.0
type Option func(s *Server)
Option is a server option
func WithCacheSize ¶ added in v0.2.0
WithCacheSize sets the cache size for the server
type Server ¶
type Server struct { storage.FlagStore storage.SegmentStore storage.RuleStore // contains filtered or unexported fields }
Server serves the Flipt backend
func (*Server) CreateConstraint ¶
func (s *Server) CreateConstraint(ctx context.Context, req *flipt.CreateConstraintRequest) (*flipt.Constraint, error)
CreateConstraint creates a constraint
func (*Server) CreateDistribution ¶
func (s *Server) CreateDistribution(ctx context.Context, req *flipt.CreateDistributionRequest) (*flipt.Distribution, error)
CreateDistribution creates a distribution
func (*Server) CreateFlag ¶
CreateFlag creates a flag
func (*Server) CreateRule ¶
CreateRule creates a rule
func (*Server) CreateSegment ¶
func (s *Server) CreateSegment(ctx context.Context, req *flipt.CreateSegmentRequest) (*flipt.Segment, error)
CreateSegment creates a segment
func (*Server) CreateVariant ¶
func (s *Server) CreateVariant(ctx context.Context, req *flipt.CreateVariantRequest) (*flipt.Variant, error)
CreateVariant creates a variant
func (*Server) DeleteConstraint ¶
func (s *Server) DeleteConstraint(ctx context.Context, req *flipt.DeleteConstraintRequest) (*empty.Empty, error)
DeleteConstraint deletes a constraint
func (*Server) DeleteDistribution ¶
func (s *Server) DeleteDistribution(ctx context.Context, req *flipt.DeleteDistributionRequest) (*empty.Empty, error)
DeleteDistribution deletes a distribution
func (*Server) DeleteFlag ¶
func (s *Server) DeleteFlag(ctx context.Context, req *flipt.DeleteFlagRequest) (*empty.Empty, error)
DeleteFlag deletes a flag
func (*Server) DeleteRule ¶
func (s *Server) DeleteRule(ctx context.Context, req *flipt.DeleteRuleRequest) (*empty.Empty, error)
DeleteRule deletes a rule
func (*Server) DeleteSegment ¶
func (s *Server) DeleteSegment(ctx context.Context, req *flipt.DeleteSegmentRequest) (*empty.Empty, error)
DeleteSegment deletes a segment
func (*Server) DeleteVariant ¶
func (s *Server) DeleteVariant(ctx context.Context, req *flipt.DeleteVariantRequest) (*empty.Empty, error)
DeleteVariant deletes a variant
func (*Server) ErrorUnaryInterceptor ¶ added in v0.2.0
func (s *Server) ErrorUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
ErrorUnaryInterceptor intercepts known errors and returns the appropriate GRPC status code
func (*Server) Evaluate ¶
func (s *Server) Evaluate(ctx context.Context, req *flipt.EvaluationRequest) (*flipt.EvaluationResponse, error)
Evaluate evaluates a request for a given flag and entity
func (*Server) GetSegment ¶
func (s *Server) GetSegment(ctx context.Context, req *flipt.GetSegmentRequest) (*flipt.Segment, error)
GetSegment gets a segment
func (*Server) ListFlags ¶
func (s *Server) ListFlags(ctx context.Context, req *flipt.ListFlagRequest) (*flipt.FlagList, error)
ListFlags lists all flags
func (*Server) ListRules ¶
func (s *Server) ListRules(ctx context.Context, req *flipt.ListRuleRequest) (*flipt.RuleList, error)
ListRules lists all rules
func (*Server) ListSegments ¶
func (s *Server) ListSegments(ctx context.Context, req *flipt.ListSegmentRequest) (*flipt.SegmentList, error)
ListSegments lists all segments
func (*Server) OrderRules ¶
func (s *Server) OrderRules(ctx context.Context, req *flipt.OrderRulesRequest) (*empty.Empty, error)
OrderRules orders rules
func (*Server) UpdateConstraint ¶
func (s *Server) UpdateConstraint(ctx context.Context, req *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)
UpdateConstraint updates an existing constraint
func (*Server) UpdateDistribution ¶
func (s *Server) UpdateDistribution(ctx context.Context, req *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)
UpdateDistribution updates an existing distribution
func (*Server) UpdateFlag ¶
UpdateFlag updates an existing flag
func (*Server) UpdateRule ¶
UpdateRule updates an existing rule
func (*Server) UpdateSegment ¶
func (s *Server) UpdateSegment(ctx context.Context, req *flipt.UpdateSegmentRequest) (*flipt.Segment, error)
UpdateSegment updates an existing segment
func (*Server) UpdateVariant ¶
func (s *Server) UpdateVariant(ctx context.Context, req *flipt.UpdateVariantRequest) (*flipt.Variant, error)
UpdateVariant updates an existing variant