grpcserver

package
v0.0.0-...-984f6f0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCheckHandler

func WithCheckHandler(h CheckHandler) func(*GrpcServer)

func WithEndpointCreateHandler

func WithEndpointCreateHandler(h EndpointCreateHandler) func(*GrpcServer)

func WithEndpointDeleteHandler

func WithEndpointDeleteHandler(h EndpointDeleteHandler) func(*GrpcServer)

func WithEndpointGetHandler

func WithEndpointGetHandler(h EndpointGetHandler) func(*GrpcServer)

func WithEndpointWatchHandler

func WithEndpointWatchHandler(h EndpointWatchHandler) func(*GrpcServer)

func WithWatchHandler

func WithWatchHandler(h WatchHandler) func(*GrpcServer)

func WithWireCreateHandler

func WithWireCreateHandler(h WireCreateHandler) func(*GrpcServer)

func WithWireDeleteHandler

func WithWireDeleteHandler(h WireDeleteHandler) func(*GrpcServer)

func WithWireGetHandler

func WithWireGetHandler(h WireGetHandler) func(*GrpcServer)

func WithWireWatchHandler

func WithWireWatchHandler(h WireWatchHandler) func(*GrpcServer)

Types

type CheckHandler

Health Handlers

type Config

type Config struct {
	// gRPC server address
	Address string

	// insecure server
	Insecure bool

	// MaxRPC
	MaxRPC int64

	// request timeout
	Timeout time.Duration

	// CertDir is the directory that contains the server key and certificate. The
	// server key and certificate.
	CertDir string

	// CertName is the server certificate name. Defaults to tls.crt.
	CertName string

	// KeyName is the server key name. Defaults to tls.key.
	KeyName string

	// CaName is the ca certificate name. Defaults to ca.crt.
	CaName string
}

type EndpointGetHandler

Endpoint Handlers

type GrpcServer

type GrpcServer struct {
	wirepb.UnimplementedWireServer
	endpointpb.UnimplementedNodeEndpointServer
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, c Config, opts ...Option) *GrpcServer

func (*GrpcServer) Check

Check implements `service Health`.

func (*GrpcServer) EndpointCreate

func (*GrpcServer) EndpointDelete

func (*GrpcServer) EndpointGet

func (*GrpcServer) EndpointWatch

func (*GrpcServer) Start

func (s *GrpcServer) Start(ctx context.Context) error

func (*GrpcServer) Watch

Watch implements `service Health`.

func (*GrpcServer) WireCreate

func (s *GrpcServer) WireCreate(ctx context.Context, req *wirepb.WireRequest) (*wirepb.EmptyResponse, error)

func (*GrpcServer) WireDelete

func (s *GrpcServer) WireDelete(ctx context.Context, req *wirepb.WireRequest) (*wirepb.EmptyResponse, error)

func (*GrpcServer) WireGet

func (*GrpcServer) WireWatch

func (s *GrpcServer) WireWatch(req *wirepb.WatchRequest, stream wirepb.Wire_WireWatchServer) error

type Option

type Option func(*GrpcServer)

type WireCreateHandler

type WireCreateHandler func(context.Context, *wirepb.WireRequest) (*wirepb.EmptyResponse, error)

type WireDeleteHandler

type WireDeleteHandler func(context.Context, *wirepb.WireRequest) (*wirepb.EmptyResponse, error)

type WireGetHandler

type WireGetHandler func(context.Context, *wirepb.WireRequest) (*wirepb.WireResponse, error)

Wire Handlers

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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