grpcapi

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GRPCAuthMetadataKey      = "auth-token"
	GRPCRequestIDMetadataKey = "request-id"
)
View Source
const (
	MaxKVCommandSizeBytes = 64 * 1024 // 64KB
)

Variables

View Source
var (
	GRPCMissingAuthError     = errors.New("missing auth token")
	GRPCInvalidAuthError     = errors.New("invalid auth token")
	GRPCServerShutdownError  = errors.New("server shutting down")
	GRPCMissingMetadataError = errors.New("missing metadata; misconfigured grpc client?")
)

Functions

This section is empty.

Types

type ExternalServer

type ExternalServer struct {
	GRPCAPI
	// Must be implemented in order to satisfy the protos ExternalServer interface
	protos.UnimplementedExternalServer
}

ExternalServer implements the external GRPC API interface

func (*ExternalServer) AppRegister

func (*ExternalServer) AppRegisterReject

func (*ExternalServer) AppVerifyRegistration

func (*ExternalServer) AttachNotification

func (*ExternalServer) AttachPipeline

func (*ExternalServer) CreateNotification

func (*ExternalServer) CreatePipeline

func (*ExternalServer) DeleteAudience

func (*ExternalServer) DeleteNotification

func (*ExternalServer) DeletePipeline

func (*ExternalServer) DeleteService

func (*ExternalServer) DetachNotification

func (*ExternalServer) DetachPipeline

func (*ExternalServer) GetAll

func (*ExternalServer) GetAllStream

func (*ExternalServer) GetAudienceRates

func (*ExternalServer) GetMetrics

func (*ExternalServer) GetNotification

func (*ExternalServer) GetNotifications

func (*ExternalServer) GetPipeline

func (*ExternalServer) GetPipelines

func (*ExternalServer) GetSchema

func (*ExternalServer) PausePipeline

func (*ExternalServer) PauseTail added in v0.0.9

func (*ExternalServer) ResumePipeline

func (*ExternalServer) ResumeTail added in v0.0.9

func (*ExternalServer) Tail

func (*ExternalServer) Test

func (*ExternalServer) UpdateNotification

func (*ExternalServer) UpdatePipeline

type GRPCAPI

type GRPCAPI struct {
	Options *Options
	// contains filtered or unexported fields
}

func New

func New(o *Options) (*GRPCAPI, error)

func (*GRPCAPI) AuthServerStreamInterceptor

func (g *GRPCAPI) AuthServerStreamInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func (*GRPCAPI) AuthServerUnaryInterceptor

func (g *GRPCAPI) AuthServerUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

AuthServerUnaryInterceptor is a GRPC interceptor (middleware) that checks for a valid auth token

func (*GRPCAPI) RequestIDServerStreamInterceptor

func (g *GRPCAPI) RequestIDServerStreamInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func (*GRPCAPI) RequestIDServerUnaryInterceptor

func (g *GRPCAPI) RequestIDServerUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

RequestIDServerUnaryInterceptor will set a request ID if one is not already set

func (*GRPCAPI) Run

func (g *GRPCAPI) Run() error

func (*GRPCAPI) TelemetryStreamInterceptor added in v0.0.10

func (g *GRPCAPI) TelemetryStreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func (*GRPCAPI) TelemetryUnaryInterceptor added in v0.0.10

func (g *GRPCAPI) TelemetryUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

type InternalServer

type InternalServer struct {
	GRPCAPI
	// Must be implemented in order to satisfy the protos InternalServer interface
	protos.UnimplementedInternalServer
}

InternalServer implements the internal GRPC API interface

func (*InternalServer) Heartbeat

func (*InternalServer) Metrics

func (*InternalServer) NewAudience

func (*InternalServer) Notify

func (*InternalServer) Register

func (*InternalServer) SendSchema

func (*InternalServer) SendTail

type Options

type Options struct {
	Config          *config.Config
	MetricsService  metrics.IMetrics
	StoreService    store.IStore
	BusService      bus.IBus
	ShutdownContext context.Context
	CmdService      cmd.ICmd
	NotifyService   notify.INotifier
	RedisBackend    *redis.Client
	PubSubService   pubsub.IPubSub
	KVService       kv.IKV
	Telemetry       statsd.Statter
	DemoMode        bool
	InstallID       string
	NodeID          string
}

Jump to

Keyboard shortcuts

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