server

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PSK_METADATA_KEY = "x-syncd-presharedkey"
)

Variables

View Source
var (
	DefaultOptions = Options{}
)

Functions

func DeregisterAllFilters

func DeregisterAllFilters(model string) (ok bool)

func DeregisterGraph

func DeregisterGraph(model string) bool

func New

func New(opt Options) api.SyncServer

func RegisterFilters

func RegisterFilters(model string, filters ...graph.Filter)

func RegisterGraph

func RegisterGraph(model string, graph graph.Graph) bool

func ServerStreamWithContext

func ServerStreamWithContext(ss grpc.ServerStream, ctx context.Context) grpc.ServerStream

Types

type Filters

type Filters map[string][]graph.Filter

type GraphResolver

type GraphResolver func(string) (graph.Graph, bool)

type Options

type Options struct {
	GraphResolver GraphResolver
	Filters       Filters
	PeerValidator PeerValidator
	Metrics       prometheus.Registerer
}

type PeerValidator

type PeerValidator func(string, string) bool

type PreSharedKey

type PreSharedKey string

func (PreSharedKey) Authn

func (psk PreSharedKey) Authn(ctx context.Context) (authz bool)

func (PreSharedKey) StreamInterceptor

func (psk PreSharedKey) StreamInterceptor(srv any, ss grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler) error

func (PreSharedKey) UnaryInterceptor

func (psk PreSharedKey) UnaryInterceptor(ctx context.Context, req any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)

Jump to

Keyboard shortcuts

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