driver

package
v0.13.0-alpha.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: 76 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogrusHookContextKey contextKeys = "logrus hook"
	RegistryContextKey   contextKeys = "registry"
)

Variables

This section is empty.

Functions

func InterceptorLogger

func InterceptorLogger(l logrus.FieldLogger) logging.Logger

InterceptorLogger adapts logrus logger to interceptor logger. This code is simple enough to be copied and not imported.

Source from: https://github.com/grpc-ecosystem/go-grpc-middleware/blob/main/interceptors/logging/examples/logrus/example_test.go

Types

type Handler

type Handler interface{}

type OPLSyntaxHandler

type OPLSyntaxHandler interface {
	RegisterSyntaxRoutes(r *x.OPLSyntaxRouter)
	RegisterSyntaxGRPC(s *grpc.Server)
}

type ReadHandler

type ReadHandler interface {
	RegisterReadRoutes(r *x.ReadRouter)
	RegisterReadGRPC(s *grpc.Server)
}

type Registry

type Registry interface {
	Init(context.Context) error

	config.Provider
	x.LoggerProvider
	x.WriterProvider

	relationtuple.ManagerProvider
	expand.EngineProvider
	check.EngineProvider
	persistence.Migrator
	persistence.Provider

	PopConnection(ctx context.Context) (*pop.Connection, error)
	PopConnectionWithOpts(ctx context.Context, f ...func(*pop.ConnectionDetails)) (*pop.Connection, error)

	HealthHandler() *healthx.Handler
	Tracer(ctx context.Context) *otelx.Tracer
	MetricsHandler() *prometheus.Handler
	PrometheusManager() *prometheus.MetricsManager

	ReadRouter(ctx context.Context) http.Handler
	WriteRouter(ctx context.Context) http.Handler

	ReadGRPCServer(ctx context.Context) *grpc.Server
	WriteGRPCServer(ctx context.Context) *grpc.Server
	OplGRPCServer(ctx context.Context) *grpc.Server

	ServeAll(ctx context.Context) error
	ServeAllSQA(cmd *cobra.Command) error
}

func NewDefaultRegistry

func NewDefaultRegistry(ctx context.Context, flags *pflag.FlagSet, withoutNetwork bool, opts []ketoctx.Option) (Registry, error)

type RegistryDefault

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

func NewCRDBTestRegistry

func NewCRDBTestRegistry(t testing.TB) *RegistryDefault

func NewSqliteTestRegistry

func NewSqliteTestRegistry(t testing.TB, debugOnDisk bool, opts ...TestRegistryOption) *RegistryDefault

func NewTestRegistry

func NewTestRegistry(t testing.TB, dsn *dbx.DsnT, opts ...TestRegistryOption) *RegistryDefault

func (*RegistryDefault) Config

func (r *RegistryDefault) Config(ctx context.Context) *config.Config

func (*RegistryDefault) Contextualizer

func (r *RegistryDefault) Contextualizer() ketoctx.Contextualizer

func (*RegistryDefault) DetermineNetwork

func (r *RegistryDefault) DetermineNetwork(ctx context.Context) (*networkx.Network, error)

func (*RegistryDefault) ExpandEngine

func (r *RegistryDefault) ExpandEngine() *expand.Engine

func (*RegistryDefault) GetVersion

func (*RegistryDefault) HealthHandler

func (r *RegistryDefault) HealthHandler() *healthx.Handler

func (*RegistryDefault) HealthServer

func (r *RegistryDefault) HealthServer() *health.Server

func (*RegistryDefault) Init

func (r *RegistryDefault) Init(ctx context.Context) (err error)

func (*RegistryDefault) InitWithoutNetworkID

func (r *RegistryDefault) InitWithoutNetworkID(ctx context.Context) error

func (*RegistryDefault) Logger

func (r *RegistryDefault) Logger() *logrusx.Logger

func (*RegistryDefault) Mapper

func (r *RegistryDefault) Mapper() *relationtuple.Mapper

func (*RegistryDefault) MappingManager

func (r *RegistryDefault) MappingManager() relationtuple.MappingManager

func (*RegistryDefault) MetricsHandler

func (r *RegistryDefault) MetricsHandler() *prometheus.Handler

func (*RegistryDefault) MigrateDown

func (r *RegistryDefault) MigrateDown(ctx context.Context) error

func (*RegistryDefault) MigrateUp

func (r *RegistryDefault) MigrateUp(ctx context.Context) error

func (*RegistryDefault) MigrationBox

func (r *RegistryDefault) MigrationBox(ctx context.Context) (*popx.MigrationBox, error)

func (*RegistryDefault) NetworkID

func (r *RegistryDefault) NetworkID(ctx context.Context) uuid.UUID

func (*RegistryDefault) OPLSyntaxRouter

func (r *RegistryDefault) OPLSyntaxRouter(ctx context.Context) http.Handler

func (*RegistryDefault) OplGRPCServer

func (r *RegistryDefault) OplGRPCServer(ctx context.Context) *grpc.Server

func (*RegistryDefault) PermissionEngine

func (r *RegistryDefault) PermissionEngine() *check.Engine

func (*RegistryDefault) Persister

func (r *RegistryDefault) Persister() persistence.Persister

func (*RegistryDefault) PopConnection

func (r *RegistryDefault) PopConnection(ctx context.Context) (*pop.Connection, error)

PopConnection returns the standard connection that is kept for the whole time.

func (*RegistryDefault) PopConnectionWithOpts

func (r *RegistryDefault) PopConnectionWithOpts(ctx context.Context, popOpts ...func(*pop.ConnectionDetails)) (*pop.Connection, error)

func (*RegistryDefault) PrometheusManager

func (r *RegistryDefault) PrometheusManager() *prometheus.MetricsManager

func (*RegistryDefault) ReadGRPCServer

func (r *RegistryDefault) ReadGRPCServer(ctx context.Context) *grpc.Server

func (*RegistryDefault) ReadOnlyMapper

func (r *RegistryDefault) ReadOnlyMapper() *relationtuple.Mapper

func (*RegistryDefault) ReadRouter

func (r *RegistryDefault) ReadRouter(ctx context.Context) http.Handler

func (*RegistryDefault) RelationTupleManager

func (r *RegistryDefault) RelationTupleManager() relationtuple.Manager

func (*RegistryDefault) ServeAll

func (r *RegistryDefault) ServeAll(ctx context.Context) error

func (*RegistryDefault) ServeAllSQA

func (r *RegistryDefault) ServeAllSQA(cmd *cobra.Command) error

func (*RegistryDefault) Tracer

func (r *RegistryDefault) Tracer(ctx context.Context) *otelx.Tracer

func (*RegistryDefault) Transactor

func (r *RegistryDefault) Transactor() interface {
	Transaction(ctx context.Context, f func(ctx context.Context) error) error
}

func (*RegistryDefault) Traverser

func (r *RegistryDefault) Traverser() relationtuple.Traverser

func (*RegistryDefault) WriteGRPCServer

func (r *RegistryDefault) WriteGRPCServer(ctx context.Context) *grpc.Server

func (*RegistryDefault) WriteRouter

func (r *RegistryDefault) WriteRouter(ctx context.Context) http.Handler

func (*RegistryDefault) Writer

func (r *RegistryDefault) Writer() herodot.Writer

type TestRegistryOption

type TestRegistryOption func(t testing.TB, r *RegistryDefault)

func WithConfig

func WithConfig(key string, value any) TestRegistryOption

func WithGRPCStreamInterceptors

func WithGRPCStreamInterceptors(i ...grpc.StreamServerInterceptor) TestRegistryOption

func WithGRPCUnaryInterceptors

func WithGRPCUnaryInterceptors(i ...grpc.UnaryServerInterceptor) TestRegistryOption

func WithLogLevel

func WithLogLevel(level string) TestRegistryOption

func WithNamespaces

func WithNamespaces(namespaces []*namespace.Namespace) TestRegistryOption

func WithOPL

func WithOPL(opl string) TestRegistryOption

func WithSelfsignedTransportCredentials

func WithSelfsignedTransportCredentials() TestRegistryOption

func WithTracer

func WithTracer(tracer trace.Tracer) TestRegistryOption

type WriteHandler

type WriteHandler interface {
	RegisterWriteRoutes(r *x.WriteRouter)
	RegisterWriteGRPC(s *grpc.Server)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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