server

package
v1.0.0-alpha-12 Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginsRoot = root + ".plugins"
)

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

func Error

func Error(err error) error

func ToStruct

func ToStruct(v map[string]interface{}) *st.Struct

ToStruct converts a map[string]interface{} to a ptypes.Struct

func ToValue

func ToValue(v interface{}) *st.Value

ToValue converts an interface{} to a ptypes.Value

Types

type Options

type Options struct {
	Port                  int
	MaxConcurrentStreams  int64
	InitialWindowSize     int32
	InitialConnWindowSize int32
	TLS                   struct {
		Enabled  bool
		CertFile string
		KeyFile  string
		CAFile   string `config:"caFile"`
	} `config:"tls"`
}

func NewOptions

func NewOptions() (*Options, error)

func NewOptionsWithPath

func NewOptionsWithPath(path string) (opts *Options, err error)

type Plugin

type Plugin func(ctx context.Context) []grpc.ServerOption

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewServer

func NewServer(ctx context.Context, plugins ...Plugin) *Server

func NewServerWithOptions

func NewServerWithOptions(ctx context.Context, opt *Options, plugins ...Plugin) *Server

func (*Server) Serve

func (s *Server) Serve(ctx context.Context)

func (*Server) Server

func (s *Server) Server() *grpc.Server

func (*Server) ServiceRegistrar

func (s *Server) ServiceRegistrar() grpc.ServiceRegistrar

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context)

Jump to

Keyboard shortcuts

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