test

package
v0.0.0-...-c8afd98 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TestDataFS embed.FS

Functions

func NewApiExtensionTestPlugin

func NewApiExtensionTestPlugin(
	srv apiextensions.ManagementAPIExtensionServer,
	svcDesc *grpc.ServiceDesc,
	impl interface{},
) *plugin.ClientConfig

func NewTestClusterStore

func NewTestClusterStore(ctrl *gomock.Controller) storage.ClusterStore

func NewTestRBACStore

func NewTestRBACStore(ctrl *gomock.Controller) storage.RBACStore

func NewTestTokenStore

func NewTestTokenStore(ctx context.Context, ctrl *gomock.Controller) storage.TokenStore

func StartStandaloneTestEnvironment

func StartStandaloneTestEnvironment()

func TestData

func TestData(filename string) []byte

Types

type AuthStrategy

type AuthStrategy string
const (
	AuthStrategyDenyAll            AuthStrategy = "deny-all"
	AuthStrategyUserIDInAuthHeader AuthStrategy = "user-id-in-auth-header"
)

type Environment

type Environment struct {
	TestBin string
	Logger  *zap.SugaredLogger
	// contains filtered or unexported fields
}

func (*Environment) GatewayConfig

func (e *Environment) GatewayConfig() *v1beta1.GatewayConfig

func (*Environment) GatewayTLSConfig

func (e *Environment) GatewayTLSConfig() *tls.Config

func (*Environment) NewManagementClient

func (e *Environment) NewManagementClient() management.ManagementClient

func (*Environment) Start

func (e *Environment) Start() error

func (*Environment) StartAgent

func (e *Environment) StartAgent(id string, token *core.BootstrapToken, pins []string) (int, <-chan error)

func (*Environment) StartK8s

func (e *Environment) StartK8s() (*rest.Config, error)

func (*Environment) StartPrometheus

func (e *Environment) StartPrometheus(opniAgentPort int) int

func (*Environment) Stop

func (e *Environment) Stop() error

type Lease

type Lease struct {
	ID         int64
	Expiration time.Time
	TokenID    string
}

type LeaseStore

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

func NewLeaseStore

func NewLeaseStore(ctx context.Context) *LeaseStore

func (*LeaseStore) LeaseExpired

func (ls *LeaseStore) LeaseExpired() <-chan string

func (*LeaseStore) New

func (ls *LeaseStore) New(tokenID string, ttl time.Duration) *Lease

type TestAuthMiddleware

type TestAuthMiddleware struct {
	Strategy AuthStrategy
}

func (*TestAuthMiddleware) Description

func (m *TestAuthMiddleware) Description() string

func (*TestAuthMiddleware) Handle

func (m *TestAuthMiddleware) Handle(c *fiber.Ctx) error

Directories

Path Synopsis
mock
apiextensions
Package mock_apiextensions is a generated GoMock package.
Package mock_apiextensions is a generated GoMock package.
ext
Package mock_ext is a generated GoMock package.
Package mock_ext is a generated GoMock package.
ident
Package mock_ident is a generated GoMock package.
Package mock_ident is a generated GoMock package.
rbac
Package mock_rbac is a generated GoMock package.
Package mock_rbac is a generated GoMock package.
storage
Package mock_storage is a generated GoMock package.
Package mock_storage is a generated GoMock package.

Jump to

Keyboard shortcuts

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