evaluation

package
v1.41.1 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Evaluator

type Evaluator struct {
	// contains filtered or unexported fields
}

Evaluator is an evaluator for legacy flag evaluations.

func NewEvaluator

func NewEvaluator(logger *zap.Logger, store Storer) *Evaluator

NewEvaluator is the constructor for an Evaluator.

func (*Evaluator) Evaluate

func (e *Evaluator) Evaluate(ctx context.Context, flag *flipt.Flag, r *evaluation.EvaluationRequest) (resp *flipt.EvaluationResponse, err error)

type Server

type Server struct {
	evaluation.UnimplementedEvaluationServiceServer
	// contains filtered or unexported fields
}

Server serves the Flipt evaluate v2 gRPC Server.

func New

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

New is constructs a new Server.

func (*Server) AllowsNamespaceScopedAuthentication added in v1.31.0

func (s *Server) AllowsNamespaceScopedAuthentication(ctx context.Context) bool

func (*Server) Batch

Batch takes in a list of *evaluation.EvaluationRequest and returns their respective responses.

func (*Server) Boolean

Boolean evaluates a request for a boolean flag and entity.

func (*Server) RegisterGRPC

func (s *Server) RegisterGRPC(server *grpc.Server)

RegisterGRPC registers the EvaluateServer onto the provided gRPC Server.

func (*Server) Variant

Variant evaluates a request for a multi-variate flag and entity. It adapts the 'v2' evaluation API and proxies the request to the 'v1' evaluation API.

type Storer

type Storer interface {
	GetFlag(ctx context.Context, flag storage.ResourceRequest) (*flipt.Flag, error)
	GetEvaluationRules(ctx context.Context, flag storage.ResourceRequest) ([]*storage.EvaluationRule, error)
	GetEvaluationDistributions(ctx context.Context, ruleID storage.IDRequest) ([]*storage.EvaluationDistribution, error)
	GetEvaluationRollouts(ctx context.Context, flag storage.ResourceRequest) ([]*storage.EvaluationRollout, error)
}

Storer is the minimal abstraction for interacting with the storage layer for evaluation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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