grpc

package
v0.0.0-...-4c708ec Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultGrpcPort int = 9090
	DefaultHttpPort int = 8081
)

Variables

View Source
var ErrorNoMethod error = errors.New("no method found in context")

Functions

func MakeAuthFunc

func MakeAuthFunc(provisioner tokens.ContextProvisioner) func(context.Context) (context.Context, error)

Types

type ClientFlags

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

func SetupClientFlags

func SetupClientFlags(clientName string, flags *pflag.FlagSet) *ClientFlags

func (ClientFlags) Client

func (f ClientFlags) Client(ctx context.Context, logger logr.Logger) (*grpc.ClientConn, error)

func (ClientFlags) MustClient

func (f ClientFlags) MustClient(ctx context.Context, logger logr.Logger) *grpc.ClientConn

type DisabledAuth

type DisabledAuth struct{}

func (DisabledAuth) AuthFuncOverride

func (_ DisabledAuth) AuthFuncOverride(ctx context.Context, method string) (context.Context, error)

type Option

type Option func(options *Options) error

func WithAllowedMethods

func WithAllowedMethods(allowedMethods []string) Option

type Options

type Options struct {
	AllowedMethods []string
}

type PermissiveAuth

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

func MakePermissiveAuthFunc

func MakePermissiveAuthFunc(provisioner tokens.ContextProvisioner, allowedMethods []string) *PermissiveAuth

func (*PermissiveAuth) AuthFuncOverride

func (pa *PermissiveAuth) AuthFuncOverride(ctx context.Context, method string) (context.Context, error)

type ServerFlags

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

func SetupServerFlags

func SetupServerFlags(flags *pflag.FlagSet) *ServerFlags

func (*ServerFlags) CorsMatch

func (flags *ServerFlags) CorsMatch(origin string) bool

func (ServerFlags) CorsOrigins

func (f ServerFlags) CorsOrigins() []string

func (*ServerFlags) GRPCListen

func (flags *ServerFlags) GRPCListen(ctx context.Context) error

func (*ServerFlags) GRPCServer

func (f *ServerFlags) GRPCServer() *grpc.Server

func (ServerFlags) GrpcPort

func (f ServerFlags) GrpcPort() int

func (*ServerFlags) HTTPListen

func (flags *ServerFlags) HTTPListen(ctx context.Context) error

func (*ServerFlags) HTTPMux

func (f *ServerFlags) HTTPMux() *runtime.ServeMux

func (ServerFlags) HttpPort

func (f ServerFlags) HttpPort() int

func (*ServerFlags) Listen

func (flags *ServerFlags) Listen(ctx context.Context, logger logr.Logger) error

func (*ServerFlags) RegisterGateway

func (flags *ServerFlags) RegisterGateway(ctx context.Context, logger logr.Logger, registerGrpcFunc func(context.Context, *grpc.Server) error, registerGatewayFunc func(context.Context, *runtime.ServeMux, string, []grpc.DialOption) error) error

func (*ServerFlags) TokenProvisioner

func (f *ServerFlags) TokenProvisioner() tokens.Provisioner

func (*ServerFlags) WithOptions

func (f *ServerFlags) WithOptions(options ...Option) error

WithOptions allows the setting of options for the grpc server

Jump to

Keyboard shortcuts

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