grpc

package
v0.0.0-...-ac61c48 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunServer

func RunServer(ctx context.Context, options ...Option) error

RunServer runs the server and block the goroutine.

Types

type Option

type Option = func(option *Options)

And Option which can be applied to Options.

func WithListen

func WithListen(listener net.Listener) Option

WithListen allow to directly configure a net.Listen for the server.

func WithListenAddress

func WithListenAddress(listen string) Option

WithListenAddress the default listening address.

type Options

type Options struct {
	// Listen can be given to directly configure the port the grpc server is listening on.
	Listen net.Listener

	// ListenAddress can be used to configure a ListenAddress which is for the grpc server.
	// This will be ignored when Options.Listen is set.
	ListenAddress string
}

func (*Options) ApplyOptions

func (o *Options) ApplyOptions(options []Option)

ApplyOptions iterates over []Option and applies every single one of them.

func (*Options) InitWithDefaults

func (o *Options) InitWithDefaults()

InitDefaults initialises Options with default values for each setting.

type Server

func (Server) Index

func (Server) Index(ctx context.Context, event *types.Event) (*types.IndexResonse, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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