stubs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(registry registry.ServiceRegistry, stubdb StubDatabase) *handler

func NewStubDatabase

func NewStubDatabase() *stubDatabase

func NewStubFaker added in v0.3.0

func NewStubFaker(db StubDatabase) *stubFaker

Types

type ActiveIf added in v0.3.0

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

func NewActiveIf added in v0.3.0

func NewActiveIf(md protoreflect.MethodDescriptor, expr string) (*ActiveIf, error)

func (*ActiveIf) Eval added in v0.3.0

func (r *ActiveIf) Eval(ctx context.Context, celCtx *protocel.CELContext) (bool, error)

func (*ActiveIf) GetString added in v0.3.0

func (r *ActiveIf) GetString() string

type PriorityStubEntries added in v0.3.0

type PriorityStubEntries struct {
	Priority int
	Entries  []StubKey
}

type StatusError added in v0.0.23

type StatusError struct {
	StubsError
}

func (*StatusError) Error added in v0.0.23

func (s *StatusError) Error() string

type StubDatabase

type StubDatabase interface {
	GetStub(StubKey) (StubEntry, bool)
	GetStubs() []StubEntry
	GetStubsPrioritized(protoreflect.FullName) [][]StubEntry
	AddStub(StubEntry)
	RemoveStub(StubKey)
	RemoveAllStubs()
	NumStubs() int
}

type StubEntry added in v0.0.23

type StubEntry struct {
	Key        StubKey
	Message    protoreflect.ProtoMessage
	CELMessage protocel.CELMessage
	Error      *StatusError
	ActiveIf   *ActiveIf
	Priority   int
}

type StubKey added in v0.3.0

type StubKey struct {
	Name protoreflect.FullName
	ID   string
}

type StubsError added in v0.0.23

type StubsError = *stubsv1.Error

Alias stubs error to not conflict with error interface

Jump to

Keyboard shortcuts

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