grpc

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Package grpc provides a daemon implementation, which provides gRPC interface to the 0-stor client. The gRPC interface specification can be found at `./schema/daemon.proto`.

It can be started by using `ztor daemon` command.

Index

Constants

View Source
const (
	// DefaultMaxMsgSize is the default size msg of a server in MiB
	DefaultMaxMsgSize = 32
)

Variables

This section is empty.

Functions

func CodeToLogrusLevel

func CodeToLogrusLevel(code codes.Code) log.Level

CodeToLogrusLevel is the default 0-stor implementation of gRPC return codes to log(rus) levels for server side.

Types

type Config

type Config struct {
	// required parameters
	Pipeline   pipeline.Pipeline
	MetaClient *metastor.Client

	MaxMsgSize           int // size in MiB
	DisableLocalFSAccess bool
}

Config is used to configure a GRPC daemon manually.

type Daemon

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

Daemon represents a client daemon, exposing the client over a GRPC interface.

func New

func New(cfg Config) (*Daemon, error)

New creates new daemon with given Config.

func NewFromConfig

func NewFromConfig(cfg daemon.Config, maxMsgSize, jobCount int, disableLocalFSAccess bool) (*Daemon, error)

NewFromConfig creates new daemon with given Config.

func (*Daemon) Close

func (d *Daemon) Close() error

Close implements api.Daemon.Close

func (*Daemon) Serve

func (d *Daemon) Serve(lis net.Listener) error

Serve implements api.Daemon.Serve

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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