server

package
v1.0.0-beta.41 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func ConfigAdd

func ConfigAdd(path string)

Types

type Options

type Options struct {
	Port int
}

Options drpc server options.

func NewOptions

func NewOptions() (*Options, error)

NewOptions returns options from config file or environment vars.

func NewOptionsWithPath

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

NewOptionsWithPath unmarshals options based a given key path.

type Server

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

Server represents a drpc server.

func NewServer

func NewServer(ctx context.Context) (*Server, error)

NewServer returns a new drpc server with default options.

func NewServerWithConfigPath

func NewServerWithConfigPath(ctx context.Context, path string) (*Server, error)

NewServerWithConfigPath returns a new drpc server with options from config path.

func NewServerWithOptions

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

NewServerWithOptions returns a new drpc server with options.

func (*Server) Mux

func (s *Server) Mux() *drpcmux.Mux

Mux returns the wrapped drpc mux instance.

func (*Server) Serve

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

Serve starts drpc server.

func (*Server) Server

func (s *Server) Server() *drpcserver.Server

Server returns the wrapped drpc server instance.

func (*Server) Shutdown

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

Shutdown stops drpc server gracefully.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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