ofrep

package
v1.50.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorHandler added in v1.48.0

func ErrorHandler(logger *zap.Logger) runtime.ErrorHandlerFunc

Types

type Bridge added in v1.47.0

type Bridge interface {
	// OFREPFlagEvaluation evaluates a single flag.
	OFREPFlagEvaluation(ctx context.Context, input EvaluationBridgeInput) (EvaluationBridgeOutput, error)
}

Bridge is the interface between the OFREP specification to Flipt internals.

type EvaluationBridgeInput added in v1.47.0

type EvaluationBridgeInput struct {
	FlagKey      string
	NamespaceKey string
	EntityId     string
	Context      map[string]string
}

EvaluationBridgeInput is the input for the bridge between OFREP specficiation to Flipt internals.

type EvaluationBridgeOutput added in v1.47.0

type EvaluationBridgeOutput struct {
	FlagKey  string
	Reason   rpcevaluation.EvaluationReason
	Variant  string
	Value    any
	Metadata map[string]any
}

EvaluationBridgeOutput is the input for the bridge between Flipt internals and OFREP specficiation.

type MockBridge added in v1.48.0

type MockBridge struct {
	mock.Mock
}

MockBridge is an autogenerated mock type for the Bridge type

func NewMockBridge added in v1.48.0

func NewMockBridge(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockBridge

NewMockBridge creates a new instance of MockBridge. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockBridge) OFREPFlagEvaluation added in v1.48.0

func (_m *MockBridge) OFREPFlagEvaluation(ctx context.Context, input EvaluationBridgeInput) (EvaluationBridgeOutput, error)

OFREPFlagEvaluation provides a mock function with given fields: ctx, input

type Server

type Server struct {
	ofrep.UnimplementedOFREPServiceServer
	// contains filtered or unexported fields
}

Server servers the methods used by the OpenFeature Remote Evaluation Protocol. It will be used only with gRPC Gateway as there's no specification for gRPC itself.

func New

func New(logger *zap.Logger, cacheCfg config.CacheConfig, bridge Bridge) *Server

New constructs a new Server.

func (*Server) EvaluateBulk added in v1.48.0

func (*Server) EvaluateFlag added in v1.47.0

func (s *Server) EvaluateFlag(ctx context.Context, r *ofrep.EvaluateFlagRequest) (*ofrep.EvaluatedFlag, error)

func (*Server) GetProviderConfiguration

GetProviderConfiguration returns the configuration set by the running flipt instance.

func (*Server) RegisterGRPC

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

RegisterGRPC registers the EvaluateServer onto the provided gRPC Server.

func (*Server) SkipsAuthorization added in v1.49.2

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

Jump to

Keyboard shortcuts

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