server

package
v1.15.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 8 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 a given key path into options and returns it.

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