server

package
v1.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2022 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheUnaryInterceptor

func CacheUnaryInterceptor(cache cache.Cacher, logger *zap.Logger) grpc.UnaryServerInterceptor

CacheUnaryInterceptor caches the response of a request if the request is cacheable. TODO: we could clean this up by using generics in 1.18+ to avoid the type switch/duplicate code.

func ErrorUnaryInterceptor

func 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 EvaluationUnaryInterceptor

func EvaluationUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

EvaluationUnaryInterceptor sets required request/response fields. Note: this should be added before any caching interceptor to ensure the request id/response fields are unique.

func ValidationUnaryInterceptor

func ValidationUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)

ValidationUnaryInterceptor validates incoming requests

Types

type Server

type Server struct {
	flipt.UnimplementedFliptServer
	// contains filtered or unexported fields
}

Server serves the Flipt backend

func New

func New(logger *zap.Logger, store storage.Store) *Server

New creates a new Server

func (*Server) BatchEvaluate

BatchEvaluate evaluates a request for multiple flags and entities

func (*Server) CreateConstraint

func (s *Server) CreateConstraint(ctx context.Context, r *flipt.CreateConstraintRequest) (*flipt.Constraint, error)

CreateConstraint creates a constraint

func (*Server) CreateDistribution

func (s *Server) CreateDistribution(ctx context.Context, r *flipt.CreateDistributionRequest) (*flipt.Distribution, error)

CreateDistribution creates a distribution

func (*Server) CreateFlag

func (s *Server) CreateFlag(ctx context.Context, r *flipt.CreateFlagRequest) (*flipt.Flag, error)

CreateFlag creates a flag

func (*Server) CreateRule

func (s *Server) CreateRule(ctx context.Context, r *flipt.CreateRuleRequest) (*flipt.Rule, error)

CreateRule creates a rule

func (*Server) CreateSegment

func (s *Server) CreateSegment(ctx context.Context, r *flipt.CreateSegmentRequest) (*flipt.Segment, error)

CreateSegment creates a segment

func (*Server) CreateVariant

func (s *Server) CreateVariant(ctx context.Context, r *flipt.CreateVariantRequest) (*flipt.Variant, error)

CreateVariant creates a variant

func (*Server) DeleteConstraint

func (s *Server) DeleteConstraint(ctx context.Context, r *flipt.DeleteConstraintRequest) (*empty.Empty, error)

DeleteConstraint deletes a constraint

func (*Server) DeleteDistribution

func (s *Server) DeleteDistribution(ctx context.Context, r *flipt.DeleteDistributionRequest) (*empty.Empty, error)

DeleteDistribution deletes a distribution

func (*Server) DeleteFlag

func (s *Server) DeleteFlag(ctx context.Context, r *flipt.DeleteFlagRequest) (*empty.Empty, error)

DeleteFlag deletes a flag

func (*Server) DeleteRule

func (s *Server) DeleteRule(ctx context.Context, r *flipt.DeleteRuleRequest) (*empty.Empty, error)

DeleteRule deletes a rule

func (*Server) DeleteSegment

func (s *Server) DeleteSegment(ctx context.Context, r *flipt.DeleteSegmentRequest) (*empty.Empty, error)

DeleteSegment deletes a segment

func (*Server) DeleteVariant

func (s *Server) DeleteVariant(ctx context.Context, r *flipt.DeleteVariantRequest) (*empty.Empty, error)

DeleteVariant deletes a variant

func (*Server) Evaluate

Evaluate evaluates a request for a given flag and entity

func (*Server) GetFlag

func (s *Server) GetFlag(ctx context.Context, r *flipt.GetFlagRequest) (*flipt.Flag, error)

GetFlag gets a flag

func (*Server) GetRule

func (s *Server) GetRule(ctx context.Context, r *flipt.GetRuleRequest) (*flipt.Rule, error)

GetRule gets a rule

func (*Server) GetSegment

func (s *Server) GetSegment(ctx context.Context, r *flipt.GetSegmentRequest) (*flipt.Segment, error)

GetSegment gets a segment

func (*Server) ListFlags

func (s *Server) ListFlags(ctx context.Context, r *flipt.ListFlagRequest) (*flipt.FlagList, error)

ListFlags lists all flags

func (*Server) ListRules

func (s *Server) ListRules(ctx context.Context, r *flipt.ListRuleRequest) (*flipt.RuleList, error)

ListRules lists all rules for a flag

func (*Server) ListSegments

func (s *Server) ListSegments(ctx context.Context, r *flipt.ListSegmentRequest) (*flipt.SegmentList, error)

ListSegments lists all segments

func (*Server) OrderRules

func (s *Server) OrderRules(ctx context.Context, r *flipt.OrderRulesRequest) (*empty.Empty, error)

OrderRules orders rules

func (*Server) UpdateConstraint

func (s *Server) UpdateConstraint(ctx context.Context, r *flipt.UpdateConstraintRequest) (*flipt.Constraint, error)

UpdateConstraint updates an existing constraint

func (*Server) UpdateDistribution

func (s *Server) UpdateDistribution(ctx context.Context, r *flipt.UpdateDistributionRequest) (*flipt.Distribution, error)

UpdateDistribution updates an existing distribution

func (*Server) UpdateFlag

func (s *Server) UpdateFlag(ctx context.Context, r *flipt.UpdateFlagRequest) (*flipt.Flag, error)

UpdateFlag updates an existing flag

func (*Server) UpdateRule

func (s *Server) UpdateRule(ctx context.Context, r *flipt.UpdateRuleRequest) (*flipt.Rule, error)

UpdateRule updates an existing rule

func (*Server) UpdateSegment

func (s *Server) UpdateSegment(ctx context.Context, r *flipt.UpdateSegmentRequest) (*flipt.Segment, error)

UpdateSegment updates an existing segment

func (*Server) UpdateVariant

func (s *Server) UpdateVariant(ctx context.Context, r *flipt.UpdateVariantRequest) (*flipt.Variant, error)

UpdateVariant updates an existing variant

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL