grpcapi

package
v0.0.50 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 36 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) CreateAudience added in v0.0.32

func (*ExternalServer) CreateNotification

func (*ExternalServer) CreatePipeline

CreatePipeline creates a new pipeline and saves it to the store.

func (*ExternalServer) CreateWasm added in v0.0.41

func (*ExternalServer) DeleteAudience

DeleteAudience will delete an audience. It will error if the audience has a pipeline attached to it. To get around the error, you can set the "force" bool in the request to true. This will delete the audience and emit a SetPipelines command set to [] for any connected SDKs.

func (*ExternalServer) DeleteNotification

func (*ExternalServer) DeletePipeline

func (*ExternalServer) DeleteService

DeleteService is basically DeleteAudience - the only difference is that DeleteService will (potentially) delete *multiple* audiences (instead of one).

func (*ExternalServer) DeleteWasm added in v0.0.41

DeleteWasm will delete a Wasm module by ID. Deleting bundled Wasm modules is not allowed.

func (*ExternalServer) DetachNotification

func (*ExternalServer) GetAll

func (*ExternalServer) GetAllStream

func (*ExternalServer) GetAllWasm added in v0.0.41

func (*ExternalServer) GetAudienceRates

func (*ExternalServer) GetConfig added in v0.0.44

func (*ExternalServer) GetMetrics

func (*ExternalServer) GetNotification

func (*ExternalServer) GetNotifications

func (*ExternalServer) GetPipeline

GetPipeline returns a single pipeline by ID.

func (*ExternalServer) GetPipelines

GetPipelines returns a list of all known pipelines.

func (*ExternalServer) GetSchema

func (*ExternalServer) GetWasm added in v0.0.41

func (*ExternalServer) PausePipeline

func (*ExternalServer) PauseTail

func (*ExternalServer) ResumePipeline

func (*ExternalServer) ResumeTail

func (*ExternalServer) SetPipelines

func (*ExternalServer) Tail

func (*ExternalServer) Test

func (*ExternalServer) UpdateNotification

func (*ExternalServer) UpdatePipeline

UpdatePipeline updates an existing pipeline (and broadcasts the update which will cause the broadcast handlers to emit SetPipeline commands to any connected SDKs).

func (*ExternalServer) UpdateWasm added in v0.0.41

UpdateWasm will update _existing_ wasm. Updating bundled wasm modules is not allowed.

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

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

func (*GRPCAPI) TelemetryUnaryInterceptor

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

type GenericPipelineRequest added in v0.0.41

type GenericPipelineRequest interface {
	~*protos.CreatePipelineRequest | ~*protos.UpdatePipelineRequest
}

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
	WasmService     wasm.IWasm
	DemoMode        bool
	InstallID       string
	NodeID          string
}

Jump to

Keyboard shortcuts

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