server

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyFieldError added in v0.1.0

func EmptyFieldError(field string) error

EmptyFieldError creates an ErrInvalidField for an empty field

func InvalidFieldError added in v0.1.0

func InvalidFieldError(field, reason string) error

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

func WithCacheSize(size int) Option

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 New

func New(logger logrus.FieldLogger, db *sql.DB, opts ...Option) *Server

New creates a new Server

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

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

CreateFlag creates a flag

func (*Server) CreateRule

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

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

Evaluate evaluates a request for a given flag and entity

func (*Server) GetFlag

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

GetFlag gets a flag

func (*Server) GetRule

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

GetRule gets a rule

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

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

UpdateFlag updates an existing flag

func (*Server) UpdateRule

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

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

Jump to

Keyboard shortcuts

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