utils_test

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TestCaseIndexContextKey = TestCaseIndexContextKeyType("TestCaseIndex")
View Source
const TestCaseNameContextKey = TestCaseNameContextKeyType("TestCaseName")
View Source
const TestingTContextKey = TestingTContextKeyType("*testing.T")

Variables

This section is empty.

Functions

func ContextWithJWT added in v2.1.0

func ContextWithJWT(ctx context.Context, jwtStr string) context.Context

ContextWithJWT adds JWT as authorization-bearer token to context, returning the new context. From https://github.com/grpc-ecosystem/go-grpc-middleware/blob/master/auth/metadata_test.go

func StartOpa

func StartOpa(ctx context.Context, t *testing.T, done chan struct{}) opa_client.Clienter

Types

type MockOpaClienter added in v2.1.0

type MockOpaClienter struct {
	Loggr        *logrus.Logger
	RegoRespJSON string
}

MockOpaClienter mocks the opa_client.Clienter interface

func (MockOpaClienter) Address added in v2.1.0

func (m MockOpaClienter) Address() string

func (MockOpaClienter) CustomQuery added in v2.1.0

func (m MockOpaClienter) CustomQuery(ctx context.Context, document string, reqData, resp interface{}) error

func (MockOpaClienter) CustomQueryBytes added in v2.1.0

func (m MockOpaClienter) CustomQueryBytes(ctx context.Context, document string, reqData interface{}) ([]byte, error)

func (MockOpaClienter) CustomQueryStream added in v2.1.0

func (m MockOpaClienter) CustomQueryStream(ctx context.Context, document string, postReqBody []byte, respRdrFn opa_client.StreamReaderFn) error

func (MockOpaClienter) Health added in v2.1.0

func (m MockOpaClienter) Health() error

func (MockOpaClienter) Query added in v2.1.0

func (m MockOpaClienter) Query(ctx context.Context, reqData, resp interface{}) error

func (MockOpaClienter) String added in v2.1.0

func (m MockOpaClienter) String() string

type TestCaseIndexContextKeyType

type TestCaseIndexContextKeyType string

type TestCaseNameContextKeyType

type TestCaseNameContextKeyType string

type TestingTContextKeyType

type TestingTContextKeyType string

Jump to

Keyboard shortcuts

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